Package: org.codehaus.groovy.reflection.stdclasses

## [Java] Class IntegerCachedClass

- org.codehaus.groovy.reflection.stdclasses.IntegerCachedClass

-     public class IntegerCachedClass
      extends NumberCachedClass

  Provides optimized reflection caching for `int` and Integer. Coerces numeric arguments to int values for type-safe method invocation. Optionally allows `null` values for the boxed Integer class variant.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class CachedClass` | `EMPTY_ARRAY, classInfo, isArray, isInterface, isNumber, isPrimitive, modifiers, mopMethods`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `IntegerCachedClass(Class klazz, ClassInfo classInfo, boolean allowNull)` Constructs a cached class representation for the given integer class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `coerceArgument(Object argument)` Coerces the given numeric argument to an int value.
    `` | `public boolean` | `isAssignableFrom(Class classToTransformFrom)` Determines if the given class can be transformed to int/Integer.
    `` | `public boolean` | `isDirectlyAssignable(Object argument)` Checks if the given argument is directly assignable without type conversion.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class NumberCachedClass` | `coerceArgument, isAssignableFrom`
    `class CachedClass` | `addNewMopMethods, coerceArgument, getCachedClass, getCachedSuperClass, getConstructors, getDeclaredInterfaces, getFields, getHierarchy, getInterfaces, getMethods, getModifiers, getName, getNewMetaMethods, getSuperClassDistance, getTheClass, getTypeDescription, hashCode, isAssignableFrom, isDirectlyAssignable, isInterface, isPrimitive, isVoid, searchMethods, setNewMopMethods, toString`

- - ### Constructor Detail

    - #### public IntegerCachedClass(Class klazz, ClassInfo classInfo, boolean allowNull)

      Constructs a cached class representation for the given integer class.

      Parameters:
        `klazz` - the integer class to cache (either `int.class` or Integer.class)
        `classInfo` - the class information associated with this cached class
        `allowNull` - `true` to allow `null` values (for Integer.class), `false` for primitive `int`

  - ### Method Detail

    - #### public Object coerceArgument(Object argument)

      Coerces the given numeric argument to an int value.

      Parameters:
        `argument` - the argument to coerce
      Returns:
        the argument as an `int`, or the original argument if not a number

    - #### public boolean isAssignableFrom(Class classToTransformFrom)

      Determines if the given class can be transformed to int/Integer. Accepts integral types, boxed integral types, and BigInteger.

      Parameters:
        `classToTransformFrom` - the source class to check
      Returns:
        `true` if the class can be transformed to int, `false` otherwise

    - #### public boolean isDirectlyAssignable(Object argument)

      Checks if the given argument is directly assignable without type conversion.

      Parameters:
        `argument` - the argument to check
      Returns:
        `true` if the argument is an Integer instance, or `null` is allowed, `false` otherwise