Created
June 8, 2013 12:40
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 abstract class MessageBuilder<B extends MessageBuilder<B>>{ | |
private String name; | |
private String id; | |
public abstract Message build(); | |
String getId() { | |
return id; | |
} | |
String getName() { | |
return name; | |
} | |
protected abstract B self(); | |
public B withId(final String id) { | |
this.id = id; | |
return self(); | |
} | |
public B withName(final String name) { | |
this.name = name; | |
return self(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment