My own project, but:

Why the heck jump through all those hoops? Download lombok and you can just 
do this:

@Data public class Person {
    private final String first, last;
    private final int age;
}

And toString, getters, constructor, equals/hashCode are all taken care of.

More to the point: A person is NOT a Pair<String, Pair<String, Integer>>. Or 
at least, that's not a practical way of looking at it. Why isn't it a 
Pair<Integer, Pair<String, String>>? Pair doesn't say a whole lot, and it 
doesn't add anything particularly useful for general processing. i.e. a 
List<String> doesn't say a whole lot either, but at least that way you can 
feed your list into code that can do stuff to lists, and that code doesn't 
need to care about what kind of list this is. The amonut of generic methods 
that work on pairs is rather limited, so why do it (Other than saving 
yourself some boilerplate, for which I'm going to stick with: Project Lombok 
is a much nicer solution for that problem).

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to