Package org.springframework.expression
Class TypedValue
- java.lang.Object
- org.springframework.expression.TypedValue
- Direct Known Subclasses:
BooleanTypedValue
public class TypedValue extends Object
Encapsulates an object and aTypeDescriptor
that describes it. The type descriptor can contain generic declarations that would not be accessible through a simplegetClass()
call on the object.- Since:
- 3.0
- Author:
- Andy Clement, Juergen Hoeller
Field Summary
Fields Modifier and Type Field Description static TypedValue
NULL
TypedValue
fornull
.
Constructor Summary
Constructors Constructor Description TypedValue(Object value)
Create aTypedValue
for a simple object.TypedValue(Object value, TypeDescriptor typeDescriptor)
Create aTypedValue
for a particular value with a particularTypeDescriptor
which may contain additional generic declarations.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
TypeDescriptor
getTypeDescriptor()
Object
getValue()
int
hashCode()
String
toString()
Field Detail
NULL
public static final TypedValue NULL
TypedValue
fornull
.
Constructor Detail
TypedValue
public TypedValue(@Nullable Object value)
Create aTypedValue
for a simple object. TheTypeDescriptor
is inferred from the object, so no generic declarations are preserved.- Parameters:
value
- the object value
TypedValue
public TypedValue(@Nullable Object value, @Nullable TypeDescriptor typeDescriptor)
Create aTypedValue
for a particular value with a particularTypeDescriptor
which may contain additional generic declarations.- Parameters:
value
- the object valuetypeDescriptor
- a type descriptor describing the type of the value
Method Detail
getTypeDescriptor
@Nullable public TypeDescriptor getTypeDescriptor()