Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Spring Data Commons
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.data.util
Interface TypeInformation<S>

All Known Implementing Classes:
  ClassTypeInformation

    public interface TypeInformation<S>

Interface to access property types and resolving generics on the way. Starting with a `ClassTypeInformation` you can travers properties using `getProperty(String)` to access type information.

Author:
  Oliver Gierke

Method Summary
`TypeInformation<?>` | `getActualType()` Transparently returns the `Map` value type if the type is a `Map`, returns the component type if the type `isCollectionLike()` or the simple type if none of this applies.
`TypeInformation<?>` | `getComponentType()` Returns the component type for `Collection`s or the key type for `Map`s.
`TypeInformation<?>` | `getMapValueType()` Will return the type of the value in case the underlying type is a `Map`.
`List<TypeInformation<?>>` | `getParameterTypes(Constructor<?> constructor)`
`TypeInformation<?>` | `getProperty(String fieldname)` Returns the property information for the property with the given name.
`Class<S>` | `getType()` Returns the type of the property.
`boolean` | `isCollectionLike()` Returns whether the type can be considered a collection, which means it's a container of elements, e.g. a `Collection` and `Array` or anything implementing `Iterable`.
`boolean` | `isMap()` Returns whether the property is a `Map`.

Method Detail

### getParameterTypes

    List<TypeInformation<?>> getParameterTypes(Constructor<?> constructor)

### getProperty

    TypeInformation<?> getProperty(String fieldname)

  Returns the property information for the property with the given name. Supports proeprty traversal through dot notation.

  Parameters:
    `fieldname` -
  Returns:

### isCollectionLike

    boolean isCollectionLike()

  Returns whether the type can be considered a collection, which means it's a container of elements, e.g. a `Collection` and `Array` or anything implementing `Iterable`. If this returns true you can expect `getComponentType()` to return a non-null value.

  Returns:

### getComponentType

    TypeInformation<?> getComponentType()

  Returns the component type for `Collection`s or the key type for `Map`s.

  Returns:

### isMap

    boolean isMap()

  Returns whether the property is a `Map`. If this returns true you can expect `getComponentType()` as well as `getMapValueType()` to return something not null.

  Returns:

### getMapValueType

    TypeInformation<?> getMapValueType()

  Will return the type of the value in case the underlying type is a `Map`.

  Returns:

### getType

    Class<S> getType()

  Returns the type of the property. Will resolve generics and the generic context of

  Returns:

### getActualType

    TypeInformation<?> getActualType()

  Transparently returns the `Map` value type if the type is a `Map`, returns the component type if the type `isCollectionLike()` or the simple type if none of this applies.

  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Spring Data Commons
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.