Class TogglzSwitchable<T>

java.lang.Object
org.togglz.core.proxy.TogglzSwitchable<T>

public abstract class TogglzSwitchable<T> extends Object
Simple switch which sets its delegate to one of two objects depending on the state of the specified Feature.
See Also:
  • Field Details

    • delegate

      protected T delegate
  • Constructor Details

    • TogglzSwitchable

      public TogglzSwitchable(FeatureManager featureManager, Feature feature, T active, T inactive)
  • Method Details

    • checkTogglzState

      protected final void checkTogglzState()
      Updates the internal delegate selection against the Feature state.
    • update

      public static void update(Object o)
      Manually update the internal delegation of a TogglzSwitchable against its Feature state. This is intended for use with passive switching.
      Parameters:
      o - The object to update. If null or not a TogglzSwitchable, no action is taken.