Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up CodeWriter modifiers #143

Merged
merged 1 commit into from
Aug 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public static String formatLiteral(Object value) {
* @param formatter Formatter function that formats the given object as a String.
* @return Returns the CodeWriter.
*/
public CodeWriter putFormatter(char identifier, BiFunction<Object, String, String> formatter) {
public final CodeWriter putFormatter(char identifier, BiFunction<Object, String, String> formatter) {
this.formatter.putFormatter(identifier, formatter);
return this;
}
Expand All @@ -430,7 +430,7 @@ public CodeWriter putFormatter(char identifier, BiFunction<Object, String, Strin
* @return Returns the generated code.
*/
@Override
public final String toString() {
public String toString() {
String result = currentState.toString();

// Trim excessive blank lines.
Expand Down Expand Up @@ -828,7 +828,7 @@ public final CodeWriter write(Object content, Object... args) {
* @param content Content to write if present.
* @return Returns the CodeWriter.
*/
public CodeWriter writeOptional(Object content) {
public final CodeWriter writeOptional(Object content) {
if (content == null) {
return this;
} else if (content instanceof Optional) {
Expand All @@ -846,7 +846,7 @@ public CodeWriter writeOptional(Object content) {
* @param task Method to invoke.
* @return Returns the CodeWriter.
*/
public CodeWriter call(Runnable task) {
public final CodeWriter call(Runnable task) {
task.run();
return this;
}
Expand Down Expand Up @@ -875,7 +875,7 @@ public CodeWriter putContext(String key, Object value) {
* @param mappings Key value pairs to add.
* @return Returns the CodeWriter.
*/
public CodeWriter putContext(Map<String, Object> mappings) {
public final CodeWriter putContext(Map<String, Object> mappings) {
mappings.forEach(currentState::putContext);
return this;
}
Expand Down