Skip to content

Instantly share code, notes, and snippets.

@japborst
Last active November 6, 2022 09:59
Show Gist options
  • Save japborst/bb7c027acca2454c25ea6687e7dfdb4c to your computer and use it in GitHub Desktop.
Save japborst/bb7c027acca2454c25ea6687e7dfdb4c to your computer and use it in GitHub Desktop.
static final class StringIsEmpty {
@BeforeTemplate
boolean equalsEmptyString(String string) {
return string.equals("");
}
@BeforeTemplate
boolean lengthEquals0(String string) {
return string.length() == 0;
}
@AfterTemplate
boolean after(String string) {
return string.isEmpty();
}
}
@ePaul
Copy link

ePaul commented Oct 14, 2022

Line 14 should likely be return string.isEmpty();.

@japborst
Copy link
Author

japborst commented Nov 6, 2022

@ePaul thanks for pointing out, that was indeed a typo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment