make;
private final String model;
private final String trim;
private final BigDecimal msrp;
AutoValue_Vehicle(
String make,
String model,
String trim,
BigDecimal msrp) {
if (make == null) {
throw new NullPointerException("Null make");
}
this.make = make;
if (model == null) {
throw new NullPointerException("Null model");
}
this.model = model;
if (trim == null) {
throw new NullPointerException("Null trim");
}
this.trim = trim;
if (msrp == null) {
throw new NullPointerException("Null msrp");
}
this.msrp = msrp;
}
@Override
public String getMake() {
return make;
}
@Override
public String getModel() {
return model;
}
@Override
public String getTrim() {
return trim;
}
@Override
public BigDecimal getMsrp() {
return msrp;
}
@Override
public String toString() {
return "Vehicle{"
+ "make=" + make + ", "
+ "model=" + model + ", "
+ "trim=" + trim + ", "
+ "msrp=" + msrp
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Vehicle) {
Vehicle that = (Vehicle) o;
return (this.make.equals(that.getMake()))
&& (this.model.equals(that.getModel()))
&& (this.trim.equals(that.getTrim()))
&& (this.msrp.equals(that.getMsrp()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.make.hashCode();
h *= 1000003;
h ^= this.model.hashCode();
h *= 1000003;
h ^= this.trim.hashCode();
h *= 1000003;
h ^= this.msrp.hashCode();
return h;
}
}