Skip to content

Instantly share code, notes, and snippets.

@rakawestu
Last active March 12, 2017 14:15
Show Gist options
  • Save rakawestu/4bee77640ba4438732235d94d5d6f2e6 to your computer and use it in GitHub Desktop.
Save rakawestu/4bee77640ba4438732235d94d5d6f2e6 to your computer and use it in GitHub Desktop.
Example of Library Project
public class ExampleLibrary {
private ExampleLibrary(String title, String message) {
// Initialize your Library here
}
class Builder {
private String title;
private String message;
public Builder addSomeTitle(String title) {
this.title = title;
return this;
}
public Builder addSomeMessage(String message) {
this.message = message;
return this;
}
public ExampleLibrary build() {
return ExampleLibrary(title, message);
}
}
}
public void initExampleLibrary() {
ExampleLibrary instance = new ExampleLibrary.Builder()
.addSomeTitle("title")
.addSomeMessage("message")
.build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment