com.citygrid.content.reviews
Class CGReviewsSearch
java.lang.Object
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
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
CGReviewsSearch
public CGReviewsSearch(String publisher)
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.