本文整理匯總了Java中edu.umd.cs.findbugs.ba.jsr305.JSR305NullnessAnnotations類的典型用法代碼示例。如果您正苦於以下問題:Java JSR305NullnessAnnotations類的具體用法?Java JSR305NullnessAnnotations怎麽用?Java JSR305NullnessAnnotations使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JSR305NullnessAnnotations類屬於edu.umd.cs.findbugs.ba.jsr305包,在下文中一共展示了JSR305NullnessAnnotations類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNullnessAnnotationClassDescriptor
import edu.umd.cs.findbugs.ba.jsr305.JSR305NullnessAnnotations; //導入依賴的package包/類
/**
* Convert a NullnessAnnotation into the ClassDescriptor of the equivalent
* JSR-305 nullness type qualifier.
*
* @param n
* a NullnessAnnotation
* @return ClassDescriptor of the equivalent JSR-305 nullness type qualifier
*/
private ClassDescriptor getNullnessAnnotationClassDescriptor(NullnessAnnotation n) {
if (n == NullnessAnnotation.CHECK_FOR_NULL) {
return JSR305NullnessAnnotations.CHECK_FOR_NULL;
} else if (n == NullnessAnnotation.NONNULL) {
return JSR305NullnessAnnotations.NONNULL;
} else if (n == NullnessAnnotation.NULLABLE) {
return JSR305NullnessAnnotations.NULLABLE;
} else if (n == NullnessAnnotation.UNKNOWN_NULLNESS) {
return JSR305NullnessAnnotations.NULLABLE;
} else {
throw new IllegalArgumentException("Unknown NullnessAnnotation: " + n);
}
}