Skip to content

Instantly share code, notes, and snippets.

@Ushiosan23
Created May 1, 2019 21:40
Show Gist options
  • Select an option

  • Save Ushiosan23/00ad0da1531fb46ade622b13383ce9cc to your computer and use it in GitHub Desktop.

Select an option

Save Ushiosan23/00ad0da1531fb46ade622b13383ce9cc to your computer and use it in GitHub Desktop.
NotNullAnnotation
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE})
public @interface NotNull {
String value() default "";
Class<? extends Exception> exception() default Exception.class;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment