Skip to content

Instantly share code, notes, and snippets.

@tgoossens
Last active December 15, 2015 02:59
Show Gist options
  • Save tgoossens/5191205 to your computer and use it in GitHub Desktop.
Save tgoossens/5191205 to your computer and use it in GitHub Desktop.
Immutable classes with public fields. because what the heck?
package p2;
/**
* Person with string address
*/
public final class Person{
public final String name;
public final String address; //addres defined in the same manner as person
public final JodaDate birthdate; //because java date suck
public Person(String name, String address, JodaDate birthdate){
//boring constructor stuff
}
}
package p1;
//note gist doesn't allow me to use same names twice
/**
* Person with Address address
*/
public final class Person{
public final String name;
public final Address address; //addres defined in the same manner as person
public final JodaDate birthdate; //because java date suck
public Person(String name, Address address, JodaDate birthdate){
//boring constructor stuff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment