Last active
March 12, 2017 14:15
-
-
Save rakawestu/4bee77640ba4438732235d94d5d6f2e6 to your computer and use it in GitHub Desktop.
Example of Library Project
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 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); | |
} | |
} | |
} |
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 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