public final class PreferredConstructor<T,P extends PersistentProperty<P>> extends Object
Constructor and Description |
---|
PreferredConstructor(Constructor<T> constructor,
Parameter<Object,P>... parameters)
|
Modifier and Type | Method and Description |
---|---|
Constructor<T> |
getConstructor()
Returns the underlying
Constructor . |
List<Parameter<Object,P>> |
getParameters()
Returns the
Parameter s of the executable. |
boolean |
isConstructorParameter(PersistentProperty<?> property)
Deprecated.
since 3.0, use
isCreatorParameter(PersistentProperty) instead. |
boolean |
isCreatorParameter(PersistentProperty<?> property)
Returns whether the given
PersistentProperty is referenced in a creator argument of the
PersistentEntity backing this InstanceCreatorMetadataSupport . |
boolean |
isEnclosingClassParameter(Parameter<?,P> parameter)
Returns whether the given
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.
|
boolean |
isParentParameter(Parameter<?,P> parameter)
Returns whether the given
Parameter is one referring to parent value (such as an enclosing class or a
receiver parameter). |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParameterCount, hasParameters
@SafeVarargs public PreferredConstructor(Constructor<T> constructor, Parameter<Object,P>... parameters)
constructor
- must not be null.parameters
- must not be null.public Constructor<T> getConstructor()
Constructor
.public boolean isNoArgConstructor()
InstanceCreatorMetadata.hasParameters()
public boolean isExplicitlyAnnotated()
PersistenceConstructor
).@Deprecated public boolean isConstructorParameter(PersistentProperty<?> property)
isCreatorParameter(PersistentProperty)
instead.property
- public boolean isParentParameter(Parameter<?,P> parameter)
InstanceCreatorMetadata
Parameter
is one referring to parent value (such as an enclosing class or a
receiver parameter).public boolean isEnclosingClassParameter(Parameter<?,P> parameter)
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.PersistentProperty
maps to the enclosing class.public List<Parameter<Object,P>> getParameters()
Parameter
s of the executable.getParameters
in interface InstanceCreatorMetadata<P extends PersistentProperty<P>>
public boolean isCreatorParameter(PersistentProperty<?> property)
PersistentProperty
is referenced in a creator argument of the
PersistentEntity
backing this InstanceCreatorMetadataSupport
.
Results of this call are cached and reused on the next invocation. Calling this method for a
PersistentProperty
that was not yet added to its owning PersistentEntity
will capture that state
and return the same result after adding PersistentProperty
to its entity.
isCreatorParameter
in interface InstanceCreatorMetadata<P extends PersistentProperty<P>>
property
- must not be null.PersistentProperty
is used in the creator.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.