com.citygrid.content.reviews
Class CGReviewsSearch

java.lang.Object
  extended by com.citygrid.content.reviews.CGReviewsSearch
All Implemented Interfaces:
Serializable, Cloneable

public class CGReviewsSearch
extends Object
implements Serializable, Cloneable

The reviews SDK helps to locate reviews in an area.

Let's pretend the user wanted to find reviews for movie theaters in 90045.

CGReviewsSearch search = CityGrid.reviewsSearch();
    search.setWhere("90025");
    search.setWhat("sushi");

    CGReviewsSearchResults results = search.search();
    for (CGReviewsSearchReview review : results.getReviews()) {
        // do something with the review
    }

Similar to places serch SDK CGPlacesSearch, let's pretend that user selected a review and now wishes to view the profile.

// Pretend the user selected first result and wants to display the full location data
    // Usually this is a navigation to a detail view.
    CGReviewsSearchReview review = results.getReviews()[0];

    // Get the detail (This will populate the locationId and impressionId for you)
    // You could alternatively use the locationId and impressionId yourself, but this is easier
    CGPlacesDetailLocation location = review.placesDetailLocation();
    // do something with the location, say maybe display to your user.

See Also:
Serialized Form

Field Summary
private static String CGReviewsSearchLatLonUri
           
private static String CGReviewsSearchWhereUri
           
private  int connectTimeout
           
private  boolean customerOnly
           
private  int days
           
private  String impressionId
           
private  CGLatLon latlon
           
private  int locationId
           
private  int page
           
private  String placement
           
private  String publisher
           
private  float radius
           
private  int rating
           
private  int readTimeout
           
private  int resultsPerPage
           
private  String sort
           
private  int tag
           
private  CGReviewType type
           
private  String what
           
private  String where
           
 
Constructor Summary
CGReviewsSearch(String publisher)
           
 
Method Summary
private  Map<String,Object> build()
           
 Object clone()
           
 boolean equals(Object o)
           
 int getConnectTimeout()
           
 int getDays()
           
 String getImpressionId()
           
 CGLatLon getLatlon()
           
 int getLocationId()
           
 int getPage()
           
 String getPlacement()
           
 String getPublisher()
           
 float getRadius()
           
 int getRating()
           
 int getReadTimeout()
           
 int getResultsPerPage()
           
 String getSort()
           
 int getTag()
           
 CGReviewType getType()
           
 String getWhat()
           
 String getWhere()
           
 int hashCode()
           
 boolean isCustomerOnly()
           
private  CGReviewsSearchResults processResults(org.codehaus.jackson.JsonNode parsedJson)
           
private  CGReviewsSearchReview[] processReviews(org.codehaus.jackson.JsonNode parsedReviews)
           
private  CGReviewType processType(String parsedType)
           
static CGReviewsSearch reviewsSearch()
           
static CGReviewsSearch reviewsSearchWithPlacement(String placement)
           
static CGReviewsSearch reviewsSearchWithPublisher(String publisher)
           
static CGReviewsSearch reviewsSearchWithPublisher(String publisher, String placement)
           
 CGReviewsSearchResults search()
           
 void setConnectTimeout(int connectTimeout)
           
 void setCustomerOnly(boolean customerOnly)
           
 void setDays(int days)
           
 void setImpressionId(String impressionId)
           
 void setLatlon(CGLatLon latlon)
           
 void setLocationId(int locationId)
           
 void setPage(int page)
           
 void setPlacement(String placement)
           
 void setPublisher(String publisher)
           
 void setRadius(float radius)
           
 void setRating(int rating)
           
 void setReadTimeout(int readTimeout)
           
 void setResultsPerPage(int resultsPerPage)
           
 void setSort(String sort)
           
 void setTag(int tag)
           
 void setType(CGReviewType type)
           
 void setWhat(String what)
           
 void setWhere(String where)
           
 String toString()
           
private  List<CGError> validate()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CGReviewsSearchWhereUri

private static final String CGReviewsSearchWhereUri
See Also:
Constant Field Values

CGReviewsSearchLatLonUri

private static final String CGReviewsSearchLatLonUri
See Also:
Constant Field Values

publisher

private String publisher

type

private CGReviewType type

what

private String what

tag

private int tag

where

private String where

radius

private float radius

page

private int page

resultsPerPage

private int resultsPerPage

sort

private String sort

placement

private String placement

impressionId

private String impressionId

latlon

private CGLatLon latlon

rating

private int rating

days

private int days

customerOnly

private boolean customerOnly

locationId

private int locationId

connectTimeout

private int connectTimeout

readTimeout

private int readTimeout
Constructor Detail

CGReviewsSearch

public CGReviewsSearch(String publisher)
Method Detail

reviewsSearch

public static CGReviewsSearch reviewsSearch()

reviewsSearchWithPublisher

public static CGReviewsSearch reviewsSearchWithPublisher(String publisher)

reviewsSearchWithPlacement

public static CGReviewsSearch reviewsSearchWithPlacement(String placement)

reviewsSearchWithPublisher

public static CGReviewsSearch reviewsSearchWithPublisher(String publisher,
                                                         String placement)

validate

private List<CGError> validate()

build

private Map<String,Object> build()

processType

private CGReviewType processType(String parsedType)

processReviews

private CGReviewsSearchReview[] processReviews(org.codehaus.jackson.JsonNode parsedReviews)

processResults

private CGReviewsSearchResults processResults(org.codehaus.jackson.JsonNode parsedJson)

search

public CGReviewsSearchResults search()
                              throws CGException
Throws:
CGException

getPublisher

public String getPublisher()

setPublisher

public void setPublisher(String publisher)

getType

public CGReviewType getType()

setType

public void setType(CGReviewType type)

getWhat

public String getWhat()

setWhat

public void setWhat(String what)

getTag

public int getTag()

setTag

public void setTag(int tag)

getWhere

public String getWhere()

setWhere

public void setWhere(String where)

getRadius

public float getRadius()

setRadius

public void setRadius(float radius)

getPage

public int getPage()

setPage

public void setPage(int page)

getResultsPerPage

public int getResultsPerPage()

setResultsPerPage

public void setResultsPerPage(int resultsPerPage)

getSort

public String getSort()

setSort

public void setSort(String sort)

getPlacement

public String getPlacement()

setPlacement

public void setPlacement(String placement)

getImpressionId

public String getImpressionId()

setImpressionId

public void setImpressionId(String impressionId)

getLatlon

public CGLatLon getLatlon()

setLatlon

public void setLatlon(CGLatLon latlon)

getRating

public int getRating()

setRating

public void setRating(int rating)

getDays

public int getDays()

setDays

public void setDays(int days)

isCustomerOnly

public boolean isCustomerOnly()

setCustomerOnly

public void setCustomerOnly(boolean customerOnly)

getLocationId

public int getLocationId()

setLocationId

public void setLocationId(int locationId)

getConnectTimeout

public int getConnectTimeout()

setConnectTimeout

public void setConnectTimeout(int connectTimeout)

getReadTimeout

public int getReadTimeout()

setReadTimeout

public void setReadTimeout(int readTimeout)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException


Copyright © 2011. All Rights Reserved.