public static class PropertyConstraint.Or extends Object implements PropertyConstraint
PropertyConstraint.And, PropertyConstraint.ByAnnotationType, PropertyConstraint.ByClass, PropertyConstraint.Enumeration, PropertyConstraint.ExactValue, PropertyConstraint.Or
ANY, NONE
Constructor and Description |
---|
PropertyConstraint.Or(PropertyConstraint c1,
PropertyConstraint c2)
Create a new
Or from two child constraints. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Object object)
accept returns true if the value fulfills the
constraint. |
PropertyConstraint |
getChild1()
Get the first child PropertyConstraint.
|
PropertyConstraint |
getChild2()
Get the seccond child PropertyConstraint.
|
boolean |
subConstraintOf(PropertyConstraint pc)
subConstraintOf returns true if the constraint
is a sub-constraint. |
String |
toString() |
public PropertyConstraint.Or(PropertyConstraint c1, PropertyConstraint c2)
Or
from two child constraints.c1
- the first childc2
- the seccond childpublic PropertyConstraint getChild1()
public PropertyConstraint getChild2()
public boolean accept(Object object)
PropertyConstraint
accept
returns true if the value fulfills the
constraint.
Manually compare items with the PropertyConstraint. Node:
this will ususaly be done for you in an AnnotationType instance
Use for implementing accept() on AnnotatoinTypeaccept
in interface PropertyConstraint
object
- an Object
to check.boolean
.public boolean subConstraintOf(PropertyConstraint pc)
PropertyConstraint
subConstraintOf
returns true if the constraint
is a sub-constraint.
A pair of constraints super and sub are in a superConstraint/subConstraint relationship if every object accepted by sub is also accepted by super. To put it another way, if instanceOf was used as a set-membership indicator function over some set of objects, then the set produced by super would be a superset of that produced by sub.
It is not expected that constraints will neccesarily
maintain references to super/sub types. It will be more usual
to infer this relationship by introspecting the constraints
themselves. For example,
PropertyConstraint.ByClass
will infer
subConstraintOf by looking at the possible class of all items
matching subConstraint.
subConstraintOf
in interface PropertyConstraint
pc
- a PropertyConstraint
to check.boolean
.Copyright © 2014 BioJava. All rights reserved.