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:
Josh Long
2010-10-22 19:56:29 -07:00
parent 39f9e2b9e4
commit c0f35ac7b8
2 changed files with 40 additions and 0 deletions

View File

@@ -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() ;
}

View File

@@ -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();
}
}