Class SimpleBinding

java.lang.Object
com.palantir.ptoss.cinch.core.SimpleBinding
All Implemented Interfaces:
Binding

public abstract class SimpleBinding extends Object implements 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

    Constructors
    Constructor
    Description
    Default constructor that will fire on any model update.
    SimpleBinding(T... on)
    Constructor that will make it so this Binding only fires on the given "on" parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.common.collect.ImmutableSet<Object>
    Gets the set of ModelUpdates that occurred on the last update.
    abstract void
    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>
    void
    update(T... changes)
    Fires an update on this Binding object for the specified types.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleBinding

      public SimpleBinding()
      Default constructor that will fire on any model update.
    • SimpleBinding

      public SimpleBinding(T... on)
      Constructor that will make it so this Binding only fires on the given "on" parameters.
  • Method Details

    • update

      public <T extends Enum<?> & ModelUpdate> void update(T... changes)
      Fires an update on this Binding object for the specified types.
      Specified by:
      update in interface Binding
      Parameters:
      changes - varargs of ModelUpdate types that are being fired by this call.
    • getLastChanged

      public com.google.common.collect.ImmutableSet<Object> getLastChanged()
      Gets the set of ModelUpdates 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.