Spring Data Commons

org.springframework.data.mapping
Class PreferredConstructor<T>

java.lang.Object
  extended by org.springframework.data.mapping.PreferredConstructor<T>

public class PreferredConstructor<T>
extends Object

Value object to encapsulate the constructor to be used when mapping persistent data to objects.

Author:
Jon Brisbin , Oliver Gierke

Nested Class Summary
static class PreferredConstructor.Parameter<T>
          Value object to represent constructor parameters.
 
Constructor Summary
PreferredConstructor(Constructor<T> constructor, PreferredConstructor.Parameter<?>... parameters)
          Creates a new PreferredConstructor from the given Constructor and PreferredConstructor.Parameters.
 
Method Summary
 Constructor<T> getConstructor()
          Returns the underlying Constructor.
 Iterable<PreferredConstructor.Parameter<?>> getParameters()
          Returns the PreferredConstructor.Parameters of the constructor.
 boolean hasParameters()
          Returns whether the constructor has PreferredConstructor.Parameters.
 boolean isExplicitlyAnnotated()
          Returns whether the constructor was explicitly selected (by PersistenceConstructor).
 boolean isNoArgConstructor()
          Returns whether the constructor does not have any arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreferredConstructor

public PreferredConstructor(Constructor<T> constructor,
                            PreferredConstructor.Parameter<?>... parameters)
Creates a new PreferredConstructor from the given Constructor and PreferredConstructor.Parameters.

Parameters:
constructor -
parameters -
Method Detail

getConstructor

public Constructor<T> getConstructor()
Returns the underlying Constructor.

Returns:

getParameters

public Iterable<PreferredConstructor.Parameter<?>> getParameters()
Returns the PreferredConstructor.Parameters of the constructor.

Returns:

hasParameters

public boolean hasParameters()
Returns whether the constructor has PreferredConstructor.Parameters.

Returns:
See Also:
isNoArgConstructor()

isNoArgConstructor

public boolean isNoArgConstructor()
Returns whether the constructor does not have any arguments.

Returns:
See Also:
hasParameters()

isExplicitlyAnnotated

public boolean isExplicitlyAnnotated()
Returns whether the constructor was explicitly selected (by PersistenceConstructor).

Returns:

Spring Data Commons

Copyright © 2011. All Rights Reserved.