public class ClassNameValueConstraint extends AbstractValueConstraint
key
Constructor and Description |
---|
ClassNameValueConstraint(java.lang.String key)
Construct a ClassNameConstrainedConfigValue that does not require the value to be a particular class.
|
ClassNameValueConstraint(java.lang.String key,
java.lang.Class<?> required)
Construct a ClassNameConstrainedConfigValue that requires the value to be a particular class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Get a description of this constraint suitable for use in tooltips.
|
boolean |
isValid(java.lang.String value,
Config config)
Check if a value is valid.
|
getKey, getKeys, isViolated, undefinedIsValid
public ClassNameValueConstraint(java.lang.String key)
key
- The key this constraint applies to.public ClassNameValueConstraint(java.lang.String key, java.lang.Class<?> required)
key
- The key this constraint applies to.required
- The required class.public java.lang.String getDescription()
ConfigConstraint
public boolean isValid(java.lang.String value, Config config)
ValueConstraint
value
- The value to check.config
- The Config object.