Package com.contentful.java.cma.model
Class CMAConstraint
- java.lang.Object
-
- com.contentful.java.cma.model.CMAConstraint
-
public class CMAConstraint extends java.lang.ObjectWhat constraints are applied to this rule?
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCMAConstraint.EqualsCreate an equals deciding whether the path to a field constraints a given value.static classCMAConstraint.FieldKeyPathDefine a path to a field.
-
Constructor Summary
Constructors Constructor Description CMAConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMAConstraint[]getAnd()Which constraints have to be all satisfied?CMAConstraint.EqualsgetEquals()Which condition has to be satisfied to satisfy this constraint?CMAConstraint.FieldKeyPath[]getFieldKeyPaths()On which fieldKeyPaths does this constraint act?CMAConstraint[]getNot()Which constraints do need to be not satisfied?CMAConstraint[]getOr()Which array of constraints where only one needs to be satisfied?CMAConstraintsetAnd(CMAConstraint... and)Set a new constraints which have all to be satisfied.CMAConstraintsetEquals(CMAConstraint.Equals equals)Update the condition to be satisfied to satisfy this constraint.CMAConstraintsetFieldKeyPaths(CMAConstraint.FieldKeyPath... fieldKeyPaths)Set the array of fieldKeyPaths to be used.CMAConstraintsetNot(CMAConstraint... not)Set a new array of constraints which must not be satisfied.CMAConstraintsetOr(CMAConstraint... or)Set a new list of constraints where only one be satisfied.java.lang.StringtoString()
-
-
-
Method Detail
-
getAnd
public CMAConstraint[] getAnd()
Which constraints have to be all satisfied?- Returns:
- the and constraints.
-
setAnd
public CMAConstraint setAnd(CMAConstraint... and)
Set a new constraints which have all to be satisfied.- Parameters:
and- constraints to be satisfied.- Returns:
- this constraint to for chaining.
-
getOr
public CMAConstraint[] getOr()
Which array of constraints where only one needs to be satisfied?- Returns:
- the or constraints.
-
setOr
public CMAConstraint setOr(CMAConstraint... or)
Set a new list of constraints where only one be satisfied.- Parameters:
or- constraints of which one needs to be satisfied.- Returns:
- this constraint to for chaining.
-
getNot
public CMAConstraint[] getNot()
Which constraints do need to be not satisfied?This effectively negates all the constraints.
- Returns:
- a array of not satisfied constraints.
-
setNot
public CMAConstraint setNot(CMAConstraint... not)
Set a new array of constraints which must not be satisfied.- Parameters:
not- a constraint not to be true.- Returns:
- this constraint to for chaining.
-
getEquals
public CMAConstraint.Equals getEquals()
Which condition has to be satisfied to satisfy this constraint?- Returns:
- an equals condition.
-
setEquals
public CMAConstraint setEquals(CMAConstraint.Equals equals)
Update the condition to be satisfied to satisfy this constraint.- Parameters:
equals- the equals constraint.- Returns:
- this instance for chaining.
-
getFieldKeyPaths
public CMAConstraint.FieldKeyPath[] getFieldKeyPaths()
On which fieldKeyPaths does this constraint act?- Returns:
- a array of fieldKeyPaths to be act upon.
-
setFieldKeyPaths
public CMAConstraint setFieldKeyPaths(CMAConstraint.FieldKeyPath... fieldKeyPaths)
Set the array of fieldKeyPaths to be used.- Parameters:
fieldKeyPaths- the new fieldKeyPaths to be set.- Returns:
- this instance for chaining.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-