|
Spring Data Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mapping.PreferredConstructor<T,P>
public class PreferredConstructor<T,P extends PersistentProperty<P>>
Value object to encapsulate the constructor to be used when mapping persistent data to objects.
| Nested Class Summary | |
|---|---|
static class |
PreferredConstructor.Parameter<T,P extends PersistentProperty<P>>
Value object to represent constructor parameters. |
| Constructor Summary | |
|---|---|
PreferredConstructor(Constructor<T> constructor,
PreferredConstructor.Parameter<Object,P>... parameters)
Creates a new PreferredConstructor from the given Constructor and PreferredConstructor.Parameters. |
|
| Method Summary | |
|---|---|
Constructor<T> |
getConstructor()
Returns the underlying Constructor. |
Iterable<PreferredConstructor.Parameter<Object,P>> |
getParameters()
Returns the PreferredConstructor.Parameters of the constructor. |
boolean |
hasParameters()
Returns whether the constructor has PreferredConstructor.Parameters. |
boolean |
isConstructorParameter(P property)
Returns whether the given PersistentProperty is referenced in a constructor argument of the
PersistentEntity backing this MappedConstructor. |
boolean |
isEnclosingClassParameter(PreferredConstructor.Parameter<?,P> parameter)
Returns whether the given PreferredConstructor.Parameter is one referring to an enclosing class. |
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 |
|---|
public PreferredConstructor(Constructor<T> constructor,
PreferredConstructor.Parameter<Object,P>... parameters)
PreferredConstructor from the given Constructor and PreferredConstructor.Parameters.
constructor - parameters - | Method Detail |
|---|
public Constructor<T> getConstructor()
Constructor.
public Iterable<PreferredConstructor.Parameter<Object,P>> getParameters()
PreferredConstructor.Parameters of the constructor.
public boolean hasParameters()
PreferredConstructor.Parameters.
isNoArgConstructor()public boolean isNoArgConstructor()
hasParameters()public boolean isExplicitlyAnnotated()
PersistenceConstructor).
public boolean isConstructorParameter(P property)
PersistentProperty is referenced in a constructor argument of the
PersistentEntity backing this MappedConstructor.
property - must not be null.
public boolean isEnclosingClassParameter(PreferredConstructor.Parameter<?,P> parameter)
PreferredConstructor.Parameter is one referring to an enclosing class. That is in case the class this
PreferredConstructor belongs to is a member class actually. If that's the case the compiler creates a first
constructor argument of the enclosing class type.
parameter - must not be null.
|
Spring Data Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||