@Override public boolean equals(Object obj) { if (null == obj) { return false; } if (this == obj) { return true; } return obj instanceof Place && ((Place) obj).getId().equals(this.id); }
@Override public int compareTo(Place that) { return this.id.compareTo(that.getId()); }
getPlaceOperatingHours(place.getId().toString());
//1. Search Twitter SearchResults results = twitterTemplate.searchOperations().search("#WinterIsComing"); List<Tweet> tweets = results.getTweets(); int i =0; for (Tweet tweet : tweets) { System.out.println(tweet.getUser().getName() + " Tweeted : "+tweet.getText() + " from " + tweet.getUser().getLocation() + " @ " + tweet.getCreatedAt() + tweet.getUser().getLocation() ); } //2. Search Place by GeoLocation RestTemplate restTemplate = twitterTemplate.getRestTemplate(); GeoTemplate geoTemplate = new GeoTemplate(restTemplate, true, true); List<Place> place = geoTemplate.search(37.423021, -122.083739); for (Place p : place) { System.out.println(p.getName() + " " + p.getCountry() + " "+p.getId()); } //3. Get Twitter UserProfile TwitterProfile userProfile = twitterTemplate.userOperations().getUserProfile(); System.out.println(userProfile.getName()+" has " +userProfile.getFriendsCount() + " friends");
mIdTextView.setText(Html.fromHtml(place.getId() + "")); mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + "")); mWebTextView.setText(place.getWebsiteUri() + "");
mIdTextView.setText(Html.fromHtml(place.getId() + "")); mPhoneTextView.setText(Html.fromHtml(place.getPhoneNumber() + "")); mWebTextView.setText(place.getWebsiteUri() + "");
public static void convert(Place place, Struct struct) { if (null == place) { return; } struct.put("Name", place.getName()) .put("StreetAddress", place.getStreetAddress()) .put("CountryCode", place.getCountryCode()) .put("Id", place.getId()) .put("Country", place.getCountry()) .put("PlaceType", place.getPlaceType()) .put("URL", place.getURL()) .put("FullName", place.getFullName()); }