Class SharedStateRememberConverted<U extends InputFromManager,S>
Object
SharedStateRememberConverted<U,S>
- Type Parameters:
U
- type an input is converted toS
- shared-state type
Shared-state that remembers converted inputs for corresponding unconverted inputs.
This class is intended as the shared-state for ConvertNamedChannels
.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindConvertedInputFor
(NamedChannelsInput unconverted, MessageLogger logger) Finds a converted-input that has been remembered.void
Forgets all converted inputs.The shared state.void
rememberConverted
(NamedChannelsInput unconverted, U converted, StringBuilder loggedMesssages) Remembers a converted input.void
setSharedState
(S sharedState) The shared state.
-
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 valueconverted
- the converted valueloggedMesssages
- any messages logged during the conversion.
-
findConvertedInputFor
Finds a converted-input that has been remembered.- Parameters:
unconverted
- the unconverted inputlogger
- 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.
-