Last active
December 15, 2015 02:59
-
-
Save tgoossens/5191205 to your computer and use it in GitHub Desktop.
Immutable classes with public fields. because what the heck?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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