Package: org.codehaus.groovy.reflection.stdclasses

## [Java] Class StringCachedClass

- org.codehaus.groovy.reflection.stdclasses.StringCachedClass

-     public class StringCachedClass
      extends CachedClass

  Provides optimized reflection caching for String. Coerces GString arguments to String for type-safe method invocation.

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

  - ### Constructor Summary

    Constructors
    Constructor and description
    `StringCachedClass(ClassInfo classInfo)` Constructs a cached class representation for String.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `coerceArgument(Object argument)` Coerces the given argument to String.
    `` | `public boolean` | `isAssignableFrom(Class classToTransformFrom)` Determines if the given class can be transformed to String.
    `` | `public boolean` | `isDirectlyAssignable(Object argument)` Checks if the given argument is directly assignable to String.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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 StringCachedClass(ClassInfo classInfo)

      Constructs a cached class representation for String.

      Parameters:
        `classInfo` - the class information associated with String

  - ### Method Detail

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

      Coerces the given argument to String. Converts GString arguments to String by calling `toString()`.

      Parameters:
        `argument` - the argument to coerce
      Returns:
        the argument as a String, or the original argument if not a GString

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

      Determines if the given class can be transformed to String. Accepts `null`, String, and GString subtypes.

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

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

      Checks if the given argument is directly assignable to String.

      Parameters:
        `argument` - the argument to check
      Returns:
        `true` if the argument is an instance of String, `false` otherwise