All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.terheyden.valid.NonnullByDefault Maven / Gradle / Ivy

There is a newer version: 0.0.9
Show newest version
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