
com.terheyden.valid.NonnullByDefault Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javax-validation-extras Show documentation
Show all versions of javax-validation-extras Show documentation
Javax-based validation extras
package com.terheyden.valid;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.meta.TypeQualifierDefault;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Declares the following defaults for the entire package:
* Methods should not return null.
* Method params are not null.
* Fields should never be set to null.
*
* Local vars can be null, sure, that's internal biz.
*
* This code was copied and modified from {@link ParametersAreNonnullByDefault}.
*
* @see
* Stack Overflow (1)
* Stack Overflow (2)
*/
@Documented
@Nonnull
@TypeQualifierDefault({ ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface NonnullByDefault {
// No code goes here.
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy