On Github movio / careers-presentation-2013
public class Person { private final String firstName; public Person(String firstName) { this.firstName = firstName; } public String getFirstName() { return firstName; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Person other = (Person) obj; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstName)) return false; return true; } @Override public String toString() { return "Person [firstName=" + firstName + "]"; } }
case class Person ( firstName: String )
sound like you?