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 a `TypeDescriptor` that describes it.

The type descriptor can contain generic declarations that would not be accessible through a simple `getClass()` call on the object.

Since:
  3.0
Author:
  Andy Clement, Juergen Hoeller

## Field Summary

Fields
Modifier and Type
Field
Description
`static final TypedValue`
`NULL`
`TypedValue` for `null`.

## Constructor Summary

Constructors
Constructor
Description
`TypedValue(Object value)`
Create a `TypedValue` for a simple object.
`TypedValue(Object value, org.springframework.core.convert.TypeDescriptor typeDescriptor)`
Create a `TypedValue` for a particular value with a particular `TypeDescriptor` which may contain additional generic declarations.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`org.springframework.core.convert.TypeDescriptor`
`getTypeDescriptor()`
`Object`
`getValue()`
`int`
`hashCode()`
`String`
`toString()`

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

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

## Field Details

### NULL

public static final TypedValue NULL
`TypedValue` for `null`.

## Constructor Details

### TypedValue

public TypedValue(@Nullable Object value)
Create a `TypedValue` for a simple object. The `TypeDescriptor` is inferred from the object, so no generic declarations are preserved.

Parameters:
  `value` - the object value

### TypedValue

public TypedValue(@Nullable Object value, @Nullable org.springframework.core.convert.TypeDescriptor typeDescriptor)
Create a `TypedValue` for a particular value with a particular `TypeDescriptor` which may contain additional generic declarations.

Parameters:
  `value` - the object value
  `typeDescriptor` - a type descriptor describing the type of the value

## Method Details

### getValue

@Nullable public Object getValue()

### getTypeDescriptor

@Nullable public org.springframework.core.convert.TypeDescriptor getTypeDescriptor()

### equals

public boolean equals(@Nullable Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`