public abstract class ConfigConstraints<T extends BrooklynObject>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ConfigConstraints.RequiredPredicate<T>
Predicate indicating a field is required: it must not be null and if a string it must not be empty
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
ConfigConstraints(T brooklynObject) |
Modifier and Type | Method and Description |
---|---|
static void |
assertValid(Entity entity)
Checks all constraints of all config keys available to an entity.
|
static void |
assertValid(EntityAdjunct adjunct)
Checks all constraints of all config keys available to an entity adjunct.
|
static <T> void |
assertValid(Entity entity,
ConfigKey<T> key,
T value) |
static <T> void |
assertValid(Location location,
ConfigKey<T> key,
T value) |
static <any> |
forbiddenIf(java.lang.String otherKeyName) |
static <any> |
forbiddenUnless(java.lang.String otherKeyName) |
static <any> |
forbiddenUnlessAnyOf(java.util.List<java.lang.String> otherKeyNames) |
java.lang.Iterable<ConfigKey<?>> |
getViolations() |
static <T> <any> |
required() |
static <any> |
requiredIf(java.lang.String otherKeyName) |
static <any> |
requiredUnless(java.lang.String otherKeyName) |
static <any> |
requiredUnlessAnyOf(java.util.List<java.lang.String> otherKeyNames) |
static ConstraintSerialization |
serialization()
Convenience method to get the serialization routines.
|
public ConfigConstraints(T brooklynObject)
public static void assertValid(Entity entity)
If a constraint is a BrooklynObjectPredicate
then
BrooklynObjectPredicate.apply(Object, BrooklynObject)
will be used.
public static void assertValid(EntityAdjunct adjunct)
If a constraint is a BrooklynObjectPredicate
then
BrooklynObjectPredicate.apply(Object, BrooklynObject)
will be used.
public java.lang.Iterable<ConfigKey<?>> getViolations()
public static ConstraintSerialization serialization()
public static <T> <any> required()
public static <any> forbiddenIf(java.lang.String otherKeyName)
public static <any> forbiddenUnless(java.lang.String otherKeyName)
public static <any> requiredIf(java.lang.String otherKeyName)
public static <any> requiredUnless(java.lang.String otherKeyName)
public static <any> forbiddenUnlessAnyOf(java.util.List<java.lang.String> otherKeyNames)
public static <any> requiredUnlessAnyOf(java.util.List<java.lang.String> otherKeyNames)