Merge branch '2.0.x'
This commit is contained in:
commit
566056fd1a
|
|
@ -25,7 +25,7 @@ public interface HotelSummary {
|
|||
Double getAverageRating();
|
||||
|
||||
default Integer getAverageRatingRounded() {
|
||||
return (getAverageRating() != null ? (int) Math.round(getAverageRating()) : null);
|
||||
return (getAverageRating() != null) ? (int) Math.round(getAverageRating()) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class HotelServiceImpl implements HotelService {
|
|||
@Override
|
||||
public long getNumberOfReviewsWithRating(Rating rating) {
|
||||
Long count = this.ratingCount.get(rating);
|
||||
return (count != null ? count : 0);
|
||||
return (count != null) ? count : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,11 +33,6 @@ public final class VehicleIdentificationNumber {
|
|||
this.vin = vin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.vin.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
|
|
@ -49,6 +44,11 @@ public final class VehicleIdentificationNumber {
|
|||
return this.vin.equals(((VehicleIdentificationNumber) obj).vin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.vin.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.vin;
|
||||
|
|
|
|||
|
|
@ -49,11 +49,6 @@ public class VehicleDetails {
|
|||
return this.model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.make.hashCode() * 31 + this.model.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
|
|
@ -66,4 +61,9 @@ public class VehicleDetails {
|
|||
return this.make.equals(other.make) && this.model.equals(other.model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.make.hashCode() * 31 + this.model.hashCode();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
|
|||
private final String echoFormat;
|
||||
|
||||
public DefaultEchoService(String echoFormat) {
|
||||
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
|
||||
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
|
|||
private final String echoFormat;
|
||||
|
||||
public DefaultEchoService(String echoFormat) {
|
||||
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
|
||||
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class DefaultEchoService implements EchoService {
|
|||
private final String echoFormat;
|
||||
|
||||
public DefaultEchoService(String echoFormat) {
|
||||
this.echoFormat = (echoFormat != null ? echoFormat : "%s");
|
||||
this.echoFormat = (echoFormat != null) ? echoFormat : "%s";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue