Create a gist now

Instantly share code, notes, and snippets.

Generated Java source file from @AutoValue
package com.github.grundlefleck;
@javax.annotation.Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Car extends Car {
private final String model;
private final int numWheels;
AutoValue_Car(
String model,
int numWheels) {
if (model == null) {
throw new NullPointerException("Null model");
}
this.model = model;
this.numWheels = numWheels;
}
@Override
public String model() {
return model;
}
@Override
public int numWheels() {
return numWheels;
}
@Override
public String toString() {
return "Car{"
+ "model=" + model
+ ", numWheels=" + numWheels
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Car) {
Car that = (Car) o;
return (this.model.equals(that.model()))
&& (this.numWheels == that.numWheels());
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= model.hashCode();
h *= 1000003;
h ^= numWheels;
return h;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment