Package org.codehaus.groovy.reflection.stdclasses

# Class BooleanCachedClass

java.lang.Object
org.codehaus.groovy.reflection.CachedClass
org.codehaus.groovy.reflection.stdclasses.BooleanCachedClass

public class BooleanCachedClass extends CachedClass
Provides optimized reflection caching for `boolean` and `Boolean`. Optionally allows `null` values for the boxed `Boolean` class variant.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.codehaus.groovy.reflection.CachedClass

  `CachedClass.CachedMethodComparatorByName, CachedClass.CachedMethodComparatorWithString`

- ## Field Summary

  ### Fields inherited from class org.codehaus.groovy.reflection.CachedClass

  `classInfo, EMPTY_ARRAY, isArray, isInterface, isNumber, isPrimitive, modifiers, mopMethods`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BooleanCachedClass(Class klazz, ClassInfo classInfo, boolean allowNull)`
  Constructs a cached class representation for the given boolean class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isAssignableFrom(Class classToTransformFrom)`
  Determines if the given class can be transformed to boolean/Boolean.
  `boolean`
  `isDirectlyAssignable(Object argument)`
  Checks if the given argument is directly assignable without type conversion.

  ### Methods inherited from class org.codehaus.groovy.reflection.CachedClass

  `addNewMopMethods, coerceArgument, getCachedClass, getCachedSuperClass, getCallSiteLoader, getConstructors, getDeclaredInterfaces, getFields, getHierarchy, getInterfaces, getMethods, getModifiers, getName, getNewMetaMethods, getSuperClassDistance, getTheClass, getTypeDescription, hashCode, isInterface, isPrimitive, isVoid, searchMethods, setNewMopMethods, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BooleanCachedClass

    public BooleanCachedClass(Class klazz, ClassInfo classInfo, boolean allowNull)
    Constructs a cached class representation for the given boolean class.
    Parameters:
      `klazz` - the boolean class to cache (either `boolean.class` or `Boolean`.class)
      `classInfo` - the class information associated with this cached class
      `allowNull` - `true` to allow `null` values (for `Boolean`.class), `false` for primitive `boolean`

- ## Method Details

  - ### isDirectlyAssignable

    public boolean isDirectlyAssignable(Object argument)
    Checks if the given argument is directly assignable without type conversion.
    Overrides:
      `isDirectlyAssignable` in class `CachedClass`
    Parameters:
      `argument` - the argument to check
    Returns:
      `true` if the argument is a `Boolean` instance, or `null` is allowed, `false` otherwise

  - ### isAssignableFrom

    public boolean isAssignableFrom(Class classToTransformFrom)
    Determines if the given class can be transformed to boolean/Boolean.
    Overrides:
      `isAssignableFrom` in class `CachedClass`
    Parameters:
      `classToTransformFrom` - the source class to check
    Returns:
      `true` if the class can be transformed to boolean, `false` otherwise