Class InputProvider<V>


  • public final class InputProvider<V>
    extends Object
    • Method Detail

      • asFuture

        public StagedFuture<V> asFuture()
        Gets the future of this process and starts the input process on first call
        Returns:
        the future
      • withModifier

        public InputProvider<V> withModifier​(AbstractModifier<V> modifier)
        Adds a input modifier
        Parameters:
        modifier - the modifier to be added
        Returns:
        the same input provider
      • getModifier

        public <M extends AbstractModifier<V>> Optional<M> getModifier​(Class<M> modifierType)
        Gets an input modifier
        Type Parameters:
        M - the provided modifier type
        Parameters:
        modifierType - the input modifier type
        Returns:
        an java.lang.Optional containing the input modifier or null
      • hasModifier

        public boolean hasModifier​(Class<? extends AbstractModifier<V>> modifierType)
        Checks if a modifier is set
        Parameters:
        modifierType - the modifier type to be checked
        Returns:
        true if the modifier type is set otherwise false
      • withModifierExceptionHandler

        public InputProvider<V> withModifierExceptionHandler​(BiConsumer<AbstractModifier<V>,​Throwable> modifierExceptionHandler)
        Sets the modifier exception handler
        Parameters:
        modifierExceptionHandler - the handler to be set
        Returns:
        the same input provider
      • cancel

        public boolean cancel()
        Tries to cancel the input process
        Returns:
        true if the process was cancelled otherwise false
      • cancel

        public boolean cancel​(String reason)
        Tries to cancel the input process with a specified reason
        Parameters:
        reason - the reason why the process was cancelled
        Returns:
        true if the process was cancelled otherwise false
      • isCancelled

        public boolean isCancelled()
        Checks if the input process is cancelled
        Returns:
        true if process is cancelled otherwise false
      • isAvailable

        public boolean isAvailable()
        Checks if the input is available already
        Returns:
        true if the input is available otherwise false
      • getActor

        public IPlatformActor<?> getActor()
        Gets the wrapped owning actor
        Returns:
        the actor