weiboclient4j.params.Coordinate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of weiboclient4j Show documentation
Show all versions of weiboclient4j Show documentation
Java library for Sina Weibo
The newest version!
package weiboclient4j.params;
public class Coordinate extends StringParam {
private Longitude longitude;
private Latitude latitude;
public Coordinate(Longitude longitude, Latitude latitude) {
super(formatCoordinate(longitude, latitude));
this.longitude = longitude;
this.latitude = latitude;
}
public Longitude getLongitude() {
return longitude;
}
public Latitude getLatitude() {
return latitude;
}
@Override
public String toString() {
return formatCoordinate(longitude, latitude);
}
@Override
protected String paramKey() {
return "coordinate";
}
private static String formatCoordinate(Longitude longitudeParam, Latitude latitudeParam) {
return String.format("%f,%f", longitudeParam.getValue(), latitudeParam.getValue());
}
}