java.lang.Object
org.microbean.bean.BeanTypes
- All Implemented Interfaces:
Constable
A utility for working with bean types.
- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal List<TypeMirror> final voidClears caches that may be used internally by thisBeanTypes.final Optional<? extends ConstantDesc> static final booleanReturnstrueif and only if the suppliedTypeMirroris a legal bean type.
-
Constructor Details
-
BeanTypes
Creates a newBeanTypes.- Parameters:
tes- aTypeAndElementSource; must not benull
-
-
Method Details
-
describeConstable
Returns anOptionalhousing aConstantDescthat represents thisBeanTypes.This method never returns
null.The default implementation of this method relies on the presence of a
publicconstructor that accepts a singleTypeAndElementSource-typed argument.The
Optionalreturned by an invocation of this method may be, and often will be, empty.- Specified by:
describeConstablein interfaceConstable- Returns:
- an
Optionalhousing aConstantDescthat represents thisBeanTypes; nevernull - See Also:
-
clearCaches
Clears caches that may be used internally by thisBeanTypes.- Idempotency:
- This method may clear internal state but otherwise has no side effects.
- Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
beanTypes
Returns an immutableListof legal bean types that the suppliedTypeMirrorbears.The returned
Listmay be empty.- Parameters:
t- aTypeMirror; must not benull- Returns:
- an immutable
Listof legal bean types that the suppliedTypeMirrorbears; nevernull - Throws:
NullPointerException- iftisnull- Idempotency:
- This method is idempotent and returns determinate values.
- Nullability:
- This method never returns
null. - Thread Safety:
- This method is safe for concurrent use by multiple threads.
-
legalBeanType
Returnstrueif and only if the suppliedTypeMirroris a legal bean type.Legal bean types are, exactly:
- Array types whose component types are legal bean types
- Primitive types
- Declared types that contain no wildcard types for every level of containment
- Parameters:
t- aTypeMirror; must not benull- Returns:
trueif and only iftis a legal bean type;falseotherwise- Throws:
NullPointerException- iftisnull- Idempotency:
- This method is idempotent and deterministic.
- Thread Safety:
- This method itself is safe for concurrent use by multiple threads, but
TypeMirrorimplementations andTypeAndElementSourceimplementations may not be safe for such use.
-