Package com.exedio.cope
Class CopyConstraint
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.CopyConstraint
-
- All Implemented Interfaces:
Serializable
public final class CopyConstraint extends Feature
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CopyConstraint(ItemField<?> target, FunctionField<?> copy)
Deprecated.Usecopy.{@link FunctionField#copyFrom(ItemField) copyFrom}(target)
ortarget.{@link ItemField#copyTo(FunctionField) copyTo}(copy)
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
check()
FunctionField<?>
getCopy()
Deprecated.Use eithergetCopyField()
orgetCopyFunction()
instead.FunctionField<?>
getCopyField()
Returns the copy of this copy constraint, if it is not achoice constraint
.Function<?>
getCopyFunction()
Returns the copy of this copy constraint.ItemField<?>
getTarget()
FunctionField<?>
getTemplate()
boolean
isChoice()
Returns whether this copy constraint is a choice constraint.-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Constructor Detail
-
CopyConstraint
@Deprecated public CopyConstraint(ItemField<?> target, FunctionField<?> copy)
Deprecated.Usecopy.{@link FunctionField#copyFrom(ItemField) copyFrom}(target)
ortarget.{@link ItemField#copyTo(FunctionField) copyTo}(copy)
instead.
-
-
Method Detail
-
getTarget
public ItemField<?> getTarget()
-
isChoice
public boolean isChoice()
Returns whether this copy constraint is a choice constraint. A choice constraint is a special copy constraint. It constrainstarget
values to items, that do point back to the source oftarget
. Such constraints are created byItemField.choice(String)
.
-
getCopy
@Nonnull @Deprecated public FunctionField<?> getCopy()
Deprecated.Use eithergetCopyField()
orgetCopyFunction()
instead. Choose carefully! BEWARE:getCopyField()
may throw IllegalArgumentException
-
getCopyField
@Nonnull public FunctionField<?> getCopyField()
Returns the copy of this copy constraint, if it is not achoice constraint
.- Throws:
IllegalArgumentException
- if this is achoice constraint
- See Also:
getCopyFunction()
-
getCopyFunction
@Nonnull public Function<?> getCopyFunction()
Returns the copy of this copy constraint. It is either aFunctionField
or (forchoice constraints
) aThis
.- See Also:
getCopyField()
-
getTemplate
public FunctionField<?> getTemplate()
-
check
public int check()
-
-