Class BigDecimalCachedClass
java.lang.Object
org.codehaus.groovy.reflection.CachedClass
org.codehaus.groovy.reflection.stdclasses.NumberCachedClass
org.codehaus.groovy.reflection.stdclasses.DoubleCachedClass
org.codehaus.groovy.reflection.stdclasses.BigDecimalCachedClass
Provides optimized reflection caching for
BigDecimal.
Coerces numeric arguments to BigDecimal for type-safe method invocation.-
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
ConstructorsConstructorDescriptionBigDecimalCachedClass(Class klazz, ClassInfo classInfo) Constructs a cached class representation forBigDecimal. -
Method Summary
Modifier and TypeMethodDescriptioncoerceArgument(Object argument) Coerces the given numeric argument toBigDecimal.booleanisDirectlyAssignable(Object argument) Checks if the given argument is directly assignable toBigDecimal.Methods inherited from class org.codehaus.groovy.reflection.stdclasses.DoubleCachedClass
isAssignableFromMethods inherited from class org.codehaus.groovy.reflection.CachedClass
addNewMopMethods, getCachedClass, getCachedSuperClass, getCallSiteLoader, getConstructors, getDeclaredInterfaces, getFields, getHierarchy, getInterfaces, getMethods, getModifiers, getName, getNewMetaMethods, getSuperClassDistance, getTheClass, getTypeDescription, hashCode, isInterface, isPrimitive, isVoid, searchMethods, setNewMopMethods, toString
-
Constructor Details
-
BigDecimalCachedClass
Constructs a cached class representation forBigDecimal.- Parameters:
klazz- theBigDecimalclass to cacheclassInfo- the class information associated with this cached class
-
-
Method Details
-
isDirectlyAssignable
Checks if the given argument is directly assignable toBigDecimal.- Overrides:
isDirectlyAssignablein classDoubleCachedClass- Parameters:
argument- the argument to check- Returns:
trueif the argument is an instance ofBigDecimal,falseotherwise
-
coerceArgument
Coerces the given numeric argument toBigDecimal.- Overrides:
coerceArgumentin classDoubleCachedClass- Parameters:
argument- the argument to coerce- Returns:
- the argument as a
BigDecimal, or the original argument if not a number
-