Skip to content

Instantly share code, notes, and snippets.

@Riduidel
Created October 26, 2011 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Riduidel/1316141 to your computer and use it in GitHub Desktop.
Save Riduidel/1316141 to your computer and use it in GitHub Desktop.
Un exemple avec setter fluent
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