Class BetterInputs<P>


  • public abstract class BetterInputs<P>
    extends Object
    • Constructor Detail

      • BetterInputs

        public BetterInputs()
    • Method Detail

      • getKeys

        public abstract List<String> getKeys()
        Gets all known input factory keys as java.lang.String
        Returns:
        the list of all keys
      • tryGetKeyProvider

        public final Optional<IPlatformKeyProvider> tryGetKeyProvider​(Object object)
        Gets the key provider for the provided object which is supposed to be a platform identifiable object
        Parameters:
        object - the object that is supposed to be a platform identifiable object
        Returns:
        an java.lang.Optional containing the key provider for the platform identifiable object or null if the object was not a platform identifiable object
        Throws:
        IllegalArgumentException - if the platform identifiable is not valid for this platform
      • getActor

        public abstract <E> Optional<IPlatformActor<E>> getActor​(E actor)
        Gets a wrapped instance of the provided actor
        Type Parameters:
        E - the type of the actor
        Parameters:
        actor - the provided actor
        Returns:
        an java.util.Optional containing the wrapped actor or null if the actor is not supported or if the actor was null
      • getInputFactory

        public abstract Optional<InputFactory<?,​?>> getInputFactory​(String namespacedKey)
        Gets a factory by key
        Parameters:
        namespacedKey - the key of the input factory
        Returns:
        an java.util.Optional containing the requested input factory or null
        Throws:
        NullPointerException - if namespacedKey is null
      • getInputFactory

        public abstract <T> Optional<InputFactory<T,​? extends AbstractInput<T>>> getInputFactory​(String namespacedKey,
                                                                                                       Class<T> inputType)
                                                                                                throws NullPointerException
        Gets a factory by key and input type
        Type Parameters:
        T - the provided input type
        Parameters:
        namespacedKey - the key of the input factory
        inputType - the input type provided by the input provider type that the factory is creating
        Returns:
        an java.util.Optional containing the requested input factory or null
        Throws:
        NullPointerException - if either namespacedKey or inputType are null
      • createInput

        public final <T> InputBuilder<T> createInput​(Class<T> type)
        Creates a new input builder
        Type Parameters:
        T - the provided input type
        Parameters:
        type - the input type class
        Returns:
        the new input builder