Created
July 23, 2014 21:28
-
-
Save Grundlefleck/192b7acb49bbceb5d2cb to your computer and use it in GitHub Desktop.
Generated Java source file from @autovalue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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