View Javadoc
1   package examples;
2   
3   import org.pojomatic.Pojomatic;
4   import org.pojomatic.annotations.AutoProperty;
5   
6   @AutoProperty
7   public class Person {
8     private final String firstName;
9     private final String lastName;
10    private final int age;
11  
12    public Person(String firstName, String lastName, int age) {
13      this.firstName = firstName;
14      this.lastName = lastName;
15      this.age = age;
16    }
17  
18    public String getLastName() { return this.lastName; }
19    public String getFirstName() { return this.firstName; }
20    public int getAge() { return this.age; }
21  
22    @Override public int hashCode() {
23      return Pojomatic.hashCode(this);
24    }
25  
26    @Override public String toString() {
27      return Pojomatic.toString(this);
28    }
29  
30    @Override public boolean equals(Object o) {
31      return Pojomatic.equals(this, o);
32    }
33  }