standup.joke
Class JokeConstraintAllowedSchemas
java.lang.Object
standup.joke.JokeConstraintAllowedSchemas
- All Implemented Interfaces:
- JokeConstraint
public class JokeConstraintAllowedSchemas
- extends Object
- implements JokeConstraint
A JokeConstraint
that constrains a joke to use one from a given set
of Schema
s.
- Author:
- Ruli Manurung
schemaLabels
private final List<String> schemaLabels
JokeConstraintAllowedSchemas
public JokeConstraintAllowedSchemas(List<String> l)
- Constructor that provides the labels of the allowed schemas
- Parameters:
l
-
validate
public boolean validate(JokeStructure j)
- Description copied from interface:
JokeConstraint
- Returns
true
if the given JokeStructure
satisfies this
constraint, and false
if not.
- Specified by:
validate
in interface JokeConstraint
- Parameters:
j
- the JokeStructure
being validated
- Returns:
- --
true
if j
satisfies this constraint,
false
otherwise.
pruneSchemas
public List<SchemaTemplatePair> pruneSchemas(List<SchemaTemplatePair> masterSTPs)
toString
public String toString()
- Overrides:
toString
in class Object