class Address
{
private enum Component
{
NUMBER,
STREET,
STATE,
COUNTRY
}
private Map<Component, String> componentToValue = ...;
}
I'd like my class to contain two methods:
- One to indicate the value of each address component (so I can debug if anything goes wrong).
- One to return the address in a form expected by humans: "1600 Amphitheatre Parkway Mountain View, CA 94043".
What is the best-practice for Object.toString()? Is it primary meant for #1 or #2? Is there a best-practice for the naming of these methods?