public class NameValueConstraints extends Object implements Constraints
Modifier and Type | Field and Description |
---|---|
protected StringConstraints |
nameConstraints |
protected String |
separator |
protected Constraints |
valueConstraints |
protected ParameterParser |
valueParser |
Constructor and Description |
---|
NameValueConstraints()
Default constructor.
|
NameValueConstraints(StringConstraints nameConstraints,
ParameterParser valueParser,
Constraints valueConstraints,
String separator)
Creates a name/value pair constraints enforcement entity.
|
Modifier and Type | Method and Description |
---|---|
StringConstraints |
getNameConstraints() |
String |
getSeparator() |
Constraints |
getValueConstraints() |
ParameterParser |
getValueParser() |
boolean |
isValid(Serializable object)
Determines whether or not the given object is valid in the context of
these constraints.
|
protected StringConstraints nameConstraints
protected ParameterParser valueParser
protected Constraints valueConstraints
protected String separator
public NameValueConstraints()
public NameValueConstraints(StringConstraints nameConstraints, ParameterParser valueParser, Constraints valueConstraints, String separator)
nameConstraints
- constraints to use for validating name portion
or null if nonevalueParser
- parameter parser to use for parsing the value portion or null of nonevalueConstraints
- constraints to use for validating value portion
or null if noneseparator
- character used to separate the name from the value, if
null, "=" will be used as default.public String getSeparator()
public StringConstraints getNameConstraints()
public ParameterParser getValueParser()
public Constraints getValueConstraints()
public boolean isValid(Serializable object)
Constraints
isValid
in interface Constraints
object
- object to be validated against the constraintsConstraints.isValid(java.io.Serializable)
Copyright © 2015. All Rights Reserved.