Class SharedStateRememberConverted<U extends InputFromManager,S>

Object
SharedStateRememberConverted<U,S>
Type Parameters:
U - type an input is converted to
S - shared-state type

public class SharedStateRememberConverted<U extends InputFromManager,S> extends Object
Shared-state that remembers converted inputs for corresponding unconverted inputs.

This class is intended as the shared-state for ConvertNamedChannels.

Author:
Owen Feehan
  • Constructor Details

    • SharedStateRememberConverted

      public SharedStateRememberConverted()
  • Method Details

    • rememberConverted

      public void rememberConverted(NamedChannelsInput unconverted, U converted, StringBuilder loggedMesssages)
      Remembers a converted input.
      Parameters:
      unconverted - the unconverted value
      converted - the converted value
      loggedMesssages - any messages logged during the conversion.
    • findConvertedInputFor

      public Optional<U> findConvertedInputFor(NamedChannelsInput unconverted, MessageLogger logger)
      Finds a converted-input that has been remembered.
      Parameters:
      unconverted - the unconverted input
      logger - where to log any messages that occurred during conversion.
      Returns:
      the corresponding convrted input for unconverted, if it exists.
    • forgetAll

      public void forgetAll()
      Forgets all converted inputs.
    • getSharedState

      public S getSharedState()
      The shared state.
    • setSharedState

      public void setSharedState(S sharedState)
      The shared state.