BAEL-6432 - Asserting Equality on Two Classes without an Equals Method (#14193)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
package com.baeldung.assertequals;
|
||||
|
||||
public class Address {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String city;
|
||||
|
||||
private String street;
|
||||
|
||||
private String country;
|
||||
|
||||
public Address(final Long id, final String city, final String street, final String country) {
|
||||
this.id = id;
|
||||
this.city = city;
|
||||
this.street = street;
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCity(final String city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public void setStreet(final String street) {
|
||||
this.street = street;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setCountry(final String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Address{" +
|
||||
"id=" + id +
|
||||
", city='" + city + '\'' +
|
||||
", street='" + street + '\'' +
|
||||
", country='" + country + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user