org.simantics.databoard.binding.mutable
Class MutableVariantBinding
java.lang.Object
org.simantics.databoard.binding.Binding
org.simantics.databoard.binding.VariantBinding
org.simantics.databoard.binding.mutable.ImmutableVariantBinding
org.simantics.databoard.binding.mutable.MutableVariantBinding
- All Implemented Interfaces:
- java.util.Comparator<java.lang.Object>
public class MutableVariantBinding
- extends ImmutableVariantBinding
MutableVariantBinding binds VariantType to MutableVariant
Class.
Method Summary |
void |
assertInstaceIsValid(java.lang.Object obj,
java.util.Set<java.lang.Object> validInstances)
Assert the obj is valid data type |
java.lang.Object |
create(Binding binding,
java.lang.Object value)
Create a new variant object. |
boolean |
isImmutable()
Return true if the value is immutable. |
boolean |
isInstance(java.lang.Object obj)
|
void |
setContent(java.lang.Object variant,
Binding binding,
java.lang.Object value)
Set the content of an variant. |
Methods inherited from class org.simantics.databoard.binding.Binding |
assertInstaceIsValid, clone, cloneUnchecked, compare, createDefault, createDefaultUnchecked, createRandom, createRandom, createRandom, createRandomUnchecked, equals, hashValue, parseValue, parseValue, parseValueDefinition, printValue, printValueDefinition, readFromTry, readFromTryUnchecked, readFromUnchecked, serializer, toString, toString, type |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
MutableVariantBinding
public MutableVariantBinding(ClassBindingFactory bindingFactory,
AdapterFactory adapterFactory)
create
public java.lang.Object create(Binding binding,
java.lang.Object value)
throws BindingException
- Description copied from class:
VariantBinding
- Create a new variant object.
The
value
argument may be included in the result.
- Overrides:
create
in class ImmutableVariantBinding
- Parameters:
binding
- the binding of the contentvalue
- content
- Returns:
- new variant
- Throws:
BindingException
isImmutable
public boolean isImmutable()
- Description copied from class:
Binding
- Return true if the value is immutable.
This question excludes the immutability of the component types.
- Overrides:
isImmutable
in class ImmutableVariantBinding
- Returns:
true
value if immutable
isInstance
public boolean isInstance(java.lang.Object obj)
- Overrides:
isInstance
in class ImmutableVariantBinding
assertInstaceIsValid
public void assertInstaceIsValid(java.lang.Object obj,
java.util.Set<java.lang.Object> validInstances)
throws BindingException
- Description copied from class:
Binding
- Assert the obj is valid data type
- Overrides:
assertInstaceIsValid
in class ImmutableVariantBinding
- Parameters:
obj
- the instancevalidInstances
- optional set of already validated instances
- Throws:
BindingException
- on invalid instance
setContent
public void setContent(java.lang.Object variant,
Binding binding,
java.lang.Object value)
throws BindingException
- Description copied from class:
VariantBinding
- Set the content of an variant.
- Overrides:
setContent
in class ImmutableVariantBinding
- Parameters:
variant
- variant objectbinding
- content's bindingvalue
- new content
- Throws:
BindingException