Class BaseTypeVisitor.FoundRequired
java.lang.Object
org.checkerframework.common.basetype.BaseTypeVisitor.FoundRequired
- Enclosing class:
BaseTypeVisitor<Factory extends GenericAnnotatedTypeFactory<?,?, ?, ?>>
Class that lazily creates string representations of
AnnotatedTypeMirrors which are
only verbose if required to differentiate the two types.
The strings are evaluated lazily when toString() is called on the found
or required fields. This prevents expensive formatting operations when an error is
suppressed and never emitted.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionof(AnnotatedTypeMirror found, AnnotatedTypeMirror required) Creates string representations ofAnnotatedTypeMirrors which are only verbose if required to differentiate the two types.of(AnnotatedTypeMirror found, AnnotatedTypeParameterBounds required) Creates string representations ofAnnotatedTypeMirrorandAnnotatedTypeParameterBoundss which are only verbose if required to differentiate the two types.of(AnnotatedTypeParameterBounds found, AnnotatedTypeParameterBounds required) Creates string representations of twoAnnotatedTypeParameterBounds, which are only verbose if required to differentiate the two.
-
Field Details
-
found
An object whosetoString()method returns the found type's string representation. Evaluated lazily to improve performance. -
required
An object whosetoString()method returns the required type's string representation. Evaluated lazily to improve performance.
-
-
Method Details
-
of
public static BaseTypeVisitor.FoundRequired of(AnnotatedTypeMirror found, AnnotatedTypeMirror required) Creates string representations ofAnnotatedTypeMirrors which are only verbose if required to differentiate the two types.- Parameters:
found- the found annotationrequired- the required annotation- Returns:
- a string representation of the two annotations
-
of
public static BaseTypeVisitor.FoundRequired of(AnnotatedTypeMirror found, AnnotatedTypeParameterBounds required) Creates string representations ofAnnotatedTypeMirrorandAnnotatedTypeParameterBoundss which are only verbose if required to differentiate the two types.- Parameters:
found- the found annotationrequired- the required annotation- Returns:
- a string representation of the two annotations
-
of
public static BaseTypeVisitor.FoundRequired of(AnnotatedTypeParameterBounds found, AnnotatedTypeParameterBounds required) Creates string representations of twoAnnotatedTypeParameterBounds, which are only verbose if required to differentiate the two. Used for a type parameter's own declared upper and lower bounds; seeBaseTypeVisitor.OverrideChecker.isTypeParameterBoundOverrideValid(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable, org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable).- Parameters:
found- the found boundsrequired- the required bounds- Returns:
- a string representation of the two bounds
-