@Immutable public class BindingCondition extends Object implements TypeCondition
Constructor and Description |
---|
BindingCondition(Class<?> compatibleClass,
boolean allowConversion,
boolean allowCollection)
Create a binding condition
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Type entity)
Determines if the given entity matches the constraint
|
protected boolean |
isCompatibleClass(Class<?> binding,
boolean to)
Check if the given binding is compatible to the configured compatible
class
|
static boolean |
isCompatibleClass(Class<?> binding,
boolean to,
Class<?> compatibleClass,
boolean allowConversion)
Check if the given binding is compatible to the given compatible class
|
public BindingCondition(Class<?> compatibleClass, boolean allowConversion, boolean allowCollection)
compatibleClass
- the class the binding should be compatible toallowConversion
- specifies if a binding is classified as compatible
if conversion to the compatible class is possibleallowCollection
- specifies if a binding is classified as compatible
if it is a collection of the compatible classpublic boolean accept(Type entity)
EntityCondition
accept
in interface EntityCondition<Type>
entity
- the entityEntityCondition.accept(Entity)
protected boolean isCompatibleClass(Class<?> binding, boolean to)
binding
- the bindingto
- if a value of compatibleClass
shall be assigned to the
binding or vice versapublic static boolean isCompatibleClass(Class<?> binding, boolean to, Class<?> compatibleClass, boolean allowConversion)
binding
- the bindingto
- if a value of the compatible class shall be assigned to the
binding or vice versacompatibleClass
- the compatible classallowConversion
- if conversion is allowedBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a