Skip to content

Instantly share code, notes, and snippets.

@Grundlefleck
Created July 23, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Grundlefleck/192b7acb49bbceb5d2cb to your computer and use it in GitHub Desktop.
Save Grundlefleck/192b7acb49bbceb5d2cb to your computer and use it in GitHub Desktop.
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