Class SimpleBinding
java.lang.Object
com.palantir.ptoss.cinch.core.SimpleBinding
- All Implemented Interfaces:
Binding
An implementation of
Binding that hides the complicated method signature required of that
interface. Instead, implementors can override the onUpdate() function for their
listener's behavior. Any "on" parameters can be passed in at creation time.-
Constructor Summary
ConstructorsModifierConstructorDescription<T extends Enum<?> & ModelUpdate>Default constructor that will fire on any model update.<T extends Enum<?> & ModelUpdate>SimpleBinding(T... on) Constructor that will make it so thisBindingonly fires on the given "on" parameters. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<Object> Gets the set ofModelUpdates that occurred on the last update.abstract voidonUpdate()This will be called when the model is changed in a way compatible with the "on" parameters specified at compile time.<T extends Enum<?> & ModelUpdate>
voidupdate(T... changes) Fires an update on thisBindingobject for the specified types.
-
Constructor Details
-
SimpleBinding
Default constructor that will fire on any model update. -
SimpleBinding
Constructor that will make it so thisBindingonly fires on the given "on" parameters.
-
-
Method Details
-
update
Fires an update on thisBindingobject for the specified types.- Specified by:
updatein interfaceBinding- Parameters:
changes- varargs ofModelUpdatetypes that are being fired by this call.
-
getLastChanged
Gets the set ofModelUpdates that occurred on the last update. -
onUpdate
public abstract void onUpdate()This will be called when the model is changed in a way compatible with the "on" parameters specified at compile time.
-