@@ -81,19 +81,11 @@ public class Box implements Shape {
|
||||
return second;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Box [%s, %s]", first, second);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -105,10 +97,6 @@ public class Box implements Shape {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
|
||||
@@ -91,10 +91,6 @@ public class Circle implements Shape {
|
||||
return radius;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -113,10 +109,6 @@ public class Circle implements Shape {
|
||||
return ObjectUtils.nullSafeEquals(radius, circle.radius);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(center);
|
||||
@@ -124,10 +116,6 @@ public class Circle implements Shape {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Circle: [center=%s, radius=%s]", center, radius);
|
||||
|
||||
@@ -55,18 +55,10 @@ public class CustomMetric implements Metric {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.geo.Metric#getMultiplier()
|
||||
*/
|
||||
public double getMultiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.geo.Metric#getAbbreviation()
|
||||
*/
|
||||
@Override
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
|
||||
@@ -158,10 +158,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return this.metric.equals(metric) ? this : new Distance(getNormalizedValue() * metric.getMultiplier(), metric);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(@Nullable Distance that) {
|
||||
|
||||
@@ -174,10 +170,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return difference == 0 ? 0 : difference > 0 ? 1 : -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@@ -199,10 +191,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return this.metric;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -220,10 +208,6 @@ public final class Distance implements Serializable, Comparable<Distance> {
|
||||
return ObjectUtils.nullSafeEquals(metric, distance.metric);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result;
|
||||
|
||||
@@ -64,10 +64,6 @@ public class GeoPage<T> extends PageImpl<GeoResult<T>> {
|
||||
this.averageDistance = results.getAverageDistance();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.PageImpl#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -82,10 +78,6 @@ public class GeoPage<T> extends PageImpl<GeoResult<T>> {
|
||||
return super.equals(obj) && ObjectUtils.nullSafeEquals(this.averageDistance, that.averageDistance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.PageImpl#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode() + ObjectUtils.nullSafeHashCode(this.averageDistance);
|
||||
|
||||
@@ -51,10 +51,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return this.distance;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -73,10 +69,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return ObjectUtils.nullSafeEquals(distance, geoResult.distance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(content);
|
||||
@@ -84,10 +76,6 @@ public final class GeoResult<T> implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("GeoResult [content: %s, distance: %s, ]", content.toString(), distance.toString());
|
||||
|
||||
@@ -95,19 +95,11 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return Collections.unmodifiableList(results);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Iterator<GeoResult<T>> iterator() {
|
||||
return (Iterator<GeoResult<T>>) results.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -126,10 +118,6 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return ObjectUtils.nullSafeEquals(averageDistance, that.averageDistance);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(results);
|
||||
@@ -137,10 +125,6 @@ public class GeoResults<T> implements Iterable<GeoResult<T>>, Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("GeoResults: [averageDistance: %s, results: %s]", averageDistance.toString(),
|
||||
|
||||
@@ -41,18 +41,10 @@ public enum Metrics implements Metric {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.geo.Metric#getMultiplier()
|
||||
*/
|
||||
public double getMultiplier() {
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.geo.Metric#getAbbreviation()
|
||||
*/
|
||||
@Override
|
||||
public String getAbbreviation() {
|
||||
return abbreviation;
|
||||
|
||||
@@ -80,10 +80,6 @@ public class Point implements Serializable {
|
||||
return y;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
@@ -98,10 +94,6 @@ public class Point implements Serializable {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
|
||||
@@ -124,10 +116,6 @@ public class Point implements Serializable {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(Locale.ENGLISH, "Point [x=%f, y=%f]", x, y);
|
||||
|
||||
@@ -92,18 +92,10 @@ public class Polygon implements Iterable<Point>, Shape {
|
||||
return this.points;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
public Iterator<Point> iterator() {
|
||||
return this.points.iterator();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -118,19 +110,11 @@ public class Polygon implements Iterable<Point>, Shape {
|
||||
return ObjectUtils.nullSafeEquals(points, that.points);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return ObjectUtils.nullSafeHashCode(points);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("Polygon: [%s]", StringUtils.collectionToCommaDelimitedString(points));
|
||||
|
||||
@@ -57,29 +57,17 @@ public enum DistanceFormatter implements Converter<String, Distance>, Formatter<
|
||||
SUPPORTED_METRICS = Collections.unmodifiableMap(metrics);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public final Distance convert(String source) {
|
||||
return source == null ? null : doConvert(source.trim().toLowerCase(Locale.US));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public String print(Distance distance, Locale locale) {
|
||||
return distance == null ? null : String.format("%s%s", distance.getValue(), distance.getUnit().toLowerCase(locale));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public Distance parse(String text, Locale locale) throws ParseException {
|
||||
return doConvert(text.trim().toLowerCase(locale));
|
||||
|
||||
@@ -37,10 +37,6 @@ public enum PointFormatter implements Converter<String, Point>, Formatter<Point>
|
||||
|
||||
private static final String INVALID_FORMAT = "Expected two doubles separated by a comma but got '%s'!";
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Point convert(String source) {
|
||||
@@ -63,19 +59,11 @@ public enum PointFormatter implements Converter<String, Point>, Formatter<Point>
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Printer#print(java.lang.Object, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public String print(Point point, Locale locale) {
|
||||
return point == null ? null : String.format("%s,%s", point.getY(), point.getX());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.format.Parser#parse(java.lang.String, java.util.Locale)
|
||||
*/
|
||||
@Override
|
||||
public Point parse(String text, Locale locale) throws ParseException {
|
||||
return convert(text);
|
||||
|
||||
Reference in New Issue
Block a user