mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 18:41:37 +00:00
Make fields private where possible
This commit is contained in:
+4
-4
@@ -28,13 +28,13 @@ public class HotelSummary implements Serializable {
|
||||
private static final MathContext MATH_CONTEXT = new MathContext(2,
|
||||
RoundingMode.HALF_UP);
|
||||
|
||||
private City city;
|
||||
private final City city;
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
private Double averageRating;
|
||||
private final Double averageRating;
|
||||
|
||||
private Integer averageRatingRounded;
|
||||
private final Integer averageRatingRounded;
|
||||
|
||||
public HotelSummary(City city, String name, Double averageRating) {
|
||||
this.city = city;
|
||||
|
||||
+2
-2
@@ -22,9 +22,9 @@ public class RatingCount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Rating rating;
|
||||
private final Rating rating;
|
||||
|
||||
private long count;
|
||||
private final long count;
|
||||
|
||||
public RatingCount(Rating rating, long count) {
|
||||
this.rating = rating;
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ class HotelServiceImpl implements HotelService {
|
||||
|
||||
private static class ReviewsSummaryImpl implements ReviewsSummary {
|
||||
|
||||
private Map<Rating, Long> ratingCount;
|
||||
private final Map<Rating, Long> ratingCount;
|
||||
|
||||
public ReviewsSummaryImpl(List<RatingCount> ratingCounts) {
|
||||
this.ratingCount = new HashMap<Rating, Long>();
|
||||
|
||||
Reference in New Issue
Block a user