refactored the twitter package to use interface types for the domain model, which gives us wiggle room to move to Spring Social
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package org.springframework.integration.twitter.model;
|
||||
|
||||
/**
|
||||
* interface for geo location records
|
||||
*
|
||||
* @author Josh Long
|
||||
*
|
||||
*/
|
||||
public interface GeoLocation {
|
||||
double getLongitude() ;
|
||||
double getLatitude() ;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.springframework.integration.twitter.model;
|
||||
|
||||
/**
|
||||
* Implements a notion of GeoLocation that forwards calls to {@link twitter4j.GeoLocation} instance
|
||||
*
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class Twitter4jGeoLocationImpl implements GeoLocation {
|
||||
|
||||
private twitter4j.GeoLocation geoLocation;
|
||||
|
||||
public twitter4j.GeoLocation getGeoLocation() {
|
||||
return this.geoLocation;
|
||||
}
|
||||
|
||||
public Twitter4jGeoLocationImpl(twitter4j.GeoLocation gl) {
|
||||
this.geoLocation = gl;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return this.geoLocation.getLongitude();
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return this.geoLocation.getLatitude();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user