Skip to content

Instantly share code, notes, and snippets.



Last active Nov 1, 2017
What would you like to do?
import javax.annotation.Nonnull;
import javax.annotation.meta.When;
public class Message {
private final String greetingMessage = "Hello ";
public String getEchoMessage() {
return greetingMessage;
@Nonnull(when = When.MAYBE)
public String getThirdPartyMessage() {
return fetchFromExternalService();
@Nonnull(when = When.UNKNOWN)
public String getDummyMessage() {
return "foo";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.