Class BeanTypes

java.lang.Object
org.microbean.assign.Types
org.microbean.bean.BeanTypes
All Implemented Interfaces:
Constable

public final class BeanTypes extends Types
A utility for working with bean types.
Author:
Laird Nelson
See Also:
  • Constructor Details

  • Method Details

    • beanTypes

      public final List<? extends TypeMirror> beanTypes(TypeMirror t)
      Returns an immutable List of legal bean types that the supplied TypeMirror bears.

      The returned List may be empty.

      Parameters:
      t - a TypeMirror; must not be null
      Returns:
      an immutable List of legal bean types that the supplied TypeMirror bears; never null
      Throws:
      NullPointerException - if t is null
      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.
    • clearCaches

      public final void clearCaches()
      Clears caches that may be used internally by this BeanTypes.
      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.
    • legalBeanType

      public static final boolean legalBeanType(TypeMirror t)
      Returns true if and only if the supplied TypeMirror is a legal bean type.

      Legal bean types are, exactly:

      1. Array types whose component types are legal bean types
      2. Primitive types
      3. Declared types that contain no wildcard types for every level of containment
      Parameters:
      t - a TypeMirror; must not be null
      Returns:
      true if and only if t is a legal bean type; false otherwise
      Throws:
      NullPointerException - if t is null
      Idempotency:
      This method is idempotent and deterministic.
      Thread Safety:
      This method itself is safe for concurrent use by multiple threads, but TypeMirror implementations and Domain implementations may not be safe for such use.