Created
February 8, 2014 09:25
-
-
Save JensRantil/8879987 to your computer and use it in GitHub Desktop.
As close as one can get to a Java typedef. That is, wrapping a type. Lots of boilerplate code for something that could be so short and concise.
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
/** | |
* A first name. | |
* <p> | |
* In other programming languages, you would be able to write something like | |
* <code> | |
* typedef FirstName String; | |
* </code> | |
*/ | |
public class FirstName { | |
private String firstName; | |
public FirstName(String firstName) { | |
this.firstName = firstName; | |
} | |
public String value() { | |
return firstName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment