Created
October 26, 2011 12:01
-
-
Save Riduidel/1316141 to your computer and use it in GitHub Desktop.
Un exemple avec setter fluent
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
public class Example { | |
private String name; | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public Example withName(String name) { | |
this.setName(name); | |
return this; | |
} | |
public static void main(String[] args) { | |
Example e = new Example().withName("nice example, no ?"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment