@Test public void testEquals() { Temperature otherTemp = new Temperature(32.0, TemperatureType.CELSIUS); Pressure otherPress = new Pressure(1020, PressureType.H_PA); Location otherLoc = new Location("Berlin", Location.UNKNOWN, null); Weather other = new Weather("42", otherTemp, otherPress, 45, timestamp, otherLoc); Assert.assertEquals(weather, other); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Double.compare(weather.humidityInPercent, humidityInPercent) == 0 && Objects.equals(stationId, weather.stationId) && Objects.equals(temperature, weather.temperature) && Objects.equals(pressure, weather.pressure) && Objects.equals(timestamp, weather.timestamp) && Objects.equals(location, weather.location); }
Weather { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Double.compare(weather.humidityInPercent, humidityInPercent) == 0 && Objects.equals(stationId, weather.stationId) && Objects.equals(temperature, weather.temperature) && Objects.equals(pressure, weather.pressure) && Objects.equals(timestamp, weather.timestamp) && Objects.equals(location, weather.location); } }
Weather { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Double.compare(weather.humidityInPercent, humidityInPercent) == 0 && Objects.equals(stationId, weather.stationId) && Objects.equals(temperature, weather.temperature) && Objects.equals(pressure, weather.pressure) && Objects.equals(timestamp, weather.timestamp) && Objects.equals(location, weather.location); } @JsonCreator  Weather(
		@JsonProperty("stationId") String stationId,
		@JsonProperty("temperature") Temperature temperature,
		@JsonProperty("pressure")Pressure pressure,
		@JsonProperty("humidityInPercent") int humidityInPercent,
		@JsonProperty("timestamp") Instant timestamp,
		@JsonProperty("location") Location location); }
Weather { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Double.compare(weather.humidityInPercent, humidityInPercent) == 0 && Objects.equals(stationId, weather.stationId) && Objects.equals(temperature, weather.temperature) && Objects.equals(pressure, weather.pressure) && Objects.equals(timestamp, weather.timestamp) && Objects.equals(location, weather.location); } @JsonCreator  Weather(
		@JsonProperty("stationId") String stationId,
		@JsonProperty("temperature") Temperature temperature,
		@JsonProperty("pressure")Pressure pressure,
		@JsonProperty("humidityInPercent") int humidityInPercent,
		@JsonProperty("timestamp") Instant timestamp,
		@JsonProperty("location") Location location); String getStationId(); Temperature getTemperature(); Pressure getPressure(); int getHumidityInPercent(); Instant getTimestamp(); Location getLocation(); @Override boolean equals(Object o); @Override int hashCode(); }
Weather { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Weather weather = (Weather) o; return Double.compare(weather.humidityInPercent, humidityInPercent) == 0 && Objects.equals(stationId, weather.stationId) && Objects.equals(temperature, weather.temperature) && Objects.equals(pressure, weather.pressure) && Objects.equals(timestamp, weather.timestamp) && Objects.equals(location, weather.location); } @JsonCreator  Weather(
		@JsonProperty("stationId") String stationId,
		@JsonProperty("temperature") Temperature temperature,
		@JsonProperty("pressure")Pressure pressure,
		@JsonProperty("humidityInPercent") int humidityInPercent,
		@JsonProperty("timestamp") Instant timestamp,
		@JsonProperty("location") Location location); String getStationId(); Temperature getTemperature(); Pressure getPressure(); int getHumidityInPercent(); Instant getTimestamp(); Location getLocation(); @Override boolean equals(Object o); @Override int hashCode();  }