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
Class ClassTypeInformation<S>

    java.lang.Object
      org.springframework.data.util.ClassTypeInformation<S>

All Implemented Interfaces:
  TypeInformation<S>

    public class ClassTypeInformation<S>

extends Object

Property information for a plain `Class`.

Author:
  Oliver Gierke

Constructor Summary
`ClassTypeInformation(Class<S> type)` Creates `ClassTypeInformation` for the given type.

Method Summary
`protected TypeInformation<?>` | `createInfo(Type fieldType)` Creates `TypeInformation` for the given `Type`.
`boolean` | `equals(Object obj)`
`static
`<S> TypeInformation<S>`
` | `from(Class<S> type)` Simple factory method to easily create new instances of `ClassTypeInformation`.
`TypeInformation<?>` | `getActualType()` Transparently returns the `Map` value type if the type is a `Map`, returns the component type if the type `TypeInformation.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.
`protected Map<TypeVariable,Type>` | `getTypeVariableMap()` Returns the type variable map.
`int` | `hashCode()`
`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`.
`protected Class<S>` | `resolveType(Type type)` Resolves the given type into a plain `Class`.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ClassTypeInformation

    public ClassTypeInformation(Class<S> type)

  Creates `ClassTypeInformation` for the given type.

  Parameters:
    `type` -

Method Detail

### from

    public static <S> TypeInformation<S> from(Class<S> type)

  Simple factory method to easily create new instances of `ClassTypeInformation`.

  Type Parameters:
    `S` -
  Parameters:
    `type` -
  Returns:

### getType

    public Class<S> getType()

  Description copied from interface: `TypeInformation`
  Returns the type of the property. Will resolve generics and the generic context of

  Specified by:
    `getType` in interface `TypeInformation<S>`
  Returns:

### getComponentType

    public TypeInformation<?> getComponentType()

  Description copied from interface: `TypeInformation`
  Returns the component type for `Collection`s or the key type for `Map`s.

  Specified by:
    `getComponentType` in interface `TypeInformation<S>`
  Returns:

### getTypeVariableMap

    protected Map<TypeVariable,Type> getTypeVariableMap()

  Returns the type variable map. Will traverse the parents up to the root on and use it's map.

  Returns:

### createInfo

    protected TypeInformation<?> createInfo(Type fieldType)

  Creates `TypeInformation` for the given `Type`.

  Parameters:
    `fieldType` -
  Returns:

### resolveType

    protected Class<S> resolveType(Type type)

  Resolves the given type into a plain `Class`.

  Parameters:
    `type` -
  Returns:

### getParameterTypes

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

  Specified by:
    `getParameterTypes` in interface `TypeInformation<S>`

### getProperty

    public TypeInformation<?> getProperty(String fieldname)

  Description copied from interface: `TypeInformation`
  Returns the property information for the property with the given name. Supports proeprty traversal through dot notation.

  Specified by:
    `getProperty` in interface `TypeInformation<S>`
  Returns:

### getActualType

    public TypeInformation<?> getActualType()

  Description copied from interface: `TypeInformation`
  Transparently returns the `Map` value type if the type is a `Map`, returns the component type if the type `TypeInformation.isCollectionLike()` or the simple type if none of this applies.

  Specified by:
    `getActualType` in interface `TypeInformation<S>`
  Returns:

### isMap

    public boolean isMap()

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

  Specified by:
    `isMap` in interface `TypeInformation<S>`
  Returns:

### getMapValueType

    public TypeInformation<?> getMapValueType()

  Description copied from interface: `TypeInformation`
  Will return the type of the value in case the underlying type is a `Map`.

  Specified by:
    `getMapValueType` in interface `TypeInformation<S>`
  Returns:

### isCollectionLike

    public boolean isCollectionLike()

  Description copied from interface: `TypeInformation`
  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 `TypeInformation.getComponentType()` to return a non-null value.

  Specified by:
    `isCollectionLike` in interface `TypeInformation<S>`
  Returns:

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

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.