Class AbstractConstraintProvider
- java.lang.Object
-
- org.linuxforhealth.fhir.model.constraint.spi.AbstractConstraintProvider
-
- All Implemented Interfaces:
ConstraintProvider
- Direct Known Subclasses:
AbstractModelConstraintProvider
,AbstractProfileConstraintProvider
public abstract class AbstractConstraintProvider extends java.lang.Object implements ConstraintProvider
An abstract base class that implements theConstraintProider
interface
-
-
Constructor Summary
Constructors Constructor Description AbstractConstraintProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addConstraints(java.util.List<Constraint> constraints)
Add zero or more constraints to the given list of constraints.protected abstract void
addRemovalPredicates(java.util.List<java.util.function.Predicate<Constraint>> removalPredicates)
Add zero or more removal predicates to the given list of removal predicates.protected Constraint
constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.Class<? extends ConstraintValidator<?>> validationClass)
Create aConstraint
instance.protected Constraint
constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.String expression, java.lang.String source)
Create aConstraint
instance.protected Constraint
constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.String expression, java.lang.String source, java.lang.Class<? extends ConstraintValidator<?>> validatorClass)
Create aConstraint
instance.java.util.List<Constraint>
getConstraints()
Get the list of constraints for this constraint provider.java.util.List<java.util.function.Predicate<Constraint>>
getRemovalPredicates()
Get the list of removal predicates for this constraint provider.protected java.util.function.Predicate<Constraint>
idEquals(java.lang.String id)
Create a predicate that matches on the given constraint id.protected java.util.function.Predicate<Constraint>
locationEquals(java.lang.String location)
Create a predicate that matches on the given constraint location.protected java.util.function.Predicate<Constraint>
sourceEquals(java.lang.String source)
Create a predicate that matches on the given constraint source.
-
-
-
Method Detail
-
getRemovalPredicates
public final java.util.List<java.util.function.Predicate<Constraint>> getRemovalPredicates()
Description copied from interface:ConstraintProvider
Get the list of removal predicates for this constraint provider.- Specified by:
getRemovalPredicates
in interfaceConstraintProvider
- Returns:
- the list of removal predicates for this constraint provider
-
getConstraints
public final java.util.List<Constraint> getConstraints()
Description copied from interface:ConstraintProvider
Get the list of constraints for this constraint provider.- Specified by:
getConstraints
in interfaceConstraintProvider
- Returns:
- the list of constraints for this constraint provider
-
addRemovalPredicates
protected abstract void addRemovalPredicates(java.util.List<java.util.function.Predicate<Constraint>> removalPredicates)
Add zero or more removal predicates to the given list of removal predicates.- Parameters:
removalPredicates
- the list of removal predicates
-
addConstraints
protected abstract void addConstraints(java.util.List<Constraint> constraints)
Add zero or more constraints to the given list of constraints.- Parameters:
constraints
- the list of constraints
-
idEquals
protected java.util.function.Predicate<Constraint> idEquals(java.lang.String id)
Create a predicate that matches on the given constraint id.- Parameters:
id
- the id- Returns:
- a predicate that matches on the given constraint id
- See Also:
Constraint.id()
-
locationEquals
protected java.util.function.Predicate<Constraint> locationEquals(java.lang.String location)
Create a predicate that matches on the given constraint location.- Parameters:
location
- the location- Returns:
- a predicate that matches on the given constraint location
- See Also:
Constraint.location()
-
sourceEquals
protected java.util.function.Predicate<Constraint> sourceEquals(java.lang.String source)
Create a predicate that matches on the given constraint source.- Parameters:
source
- the source- Returns:
- a predicate that matches on the given constraint source
-
constraint
protected Constraint constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.Class<? extends ConstraintValidator<?>> validationClass)
Create aConstraint
instance.- Parameters:
id
- the idlevel
- the levellocation
- the locationdescription
- the descriptionvalidationClass
- the validation class- Returns:
- a
Constraint
instance
-
constraint
protected Constraint constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.String expression, java.lang.String source)
Create aConstraint
instance.- Parameters:
id
- the idlevel
- the levellocation
- the locationdescription
- the descriptionexpression
- the expressionsource
- the source- Returns:
- a
Constraint
instance
-
constraint
protected Constraint constraint(java.lang.String id, java.lang.String level, java.lang.String location, java.lang.String description, java.lang.String expression, java.lang.String source, java.lang.Class<? extends ConstraintValidator<?>> validatorClass)
Create aConstraint
instance.- Parameters:
id
- the idlevel
- the levellocation
- the locationdescription
- the descriptionexpression
- the expressionsource
- the sourcevalidatorClass
- the validator class- Returns:
- a
Constraint
instance
-
-