You probably need the getXXX methods. You can consider losing the setXXX methods.
The above shows your Person class being immutable. You can read about immutability
in the Java® Tutorials. The immutable object s a particular design
pattern; you can see from the tutorials article what its uses are.
Search for information on the “Bean Pattern”. Beans are different from immutable objects; they must have setXXX and getXXX methods and usually a public no‑arguments constructor. Beans have the advantage that they can be stored in XML files for years and retrieved. They need the setXXX methods with the correct naming conventions to enable the initial values of fields to be set. That appears inconsistent with immutability.
The
Color class appears to be immutable (it isn't really because I have managed to break it by some blatant cheating) but if you go through its constructors you find out about an annotation which may allow you to treat an immutable object as a bean. I am not sure about this, since I have never tried, however.