Class SocketHint.BasicSocketHint<T>

  • All Implemented Interfaces:
    SocketHint<T>
    Enclosing interface:
    SocketHint<T>

    public static final class SocketHint.BasicSocketHint<T>
    extends java.lang.Object
    implements SocketHint<T>
    A concrete implementation of the SocketHint class that provides the functionality of a raw SocketHint.
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        Description copied from interface: SocketHint
        The name for this socket.
        Specified by:
        getIdentifier in interface SocketHint<T>
      • getType

        public java.lang.Class<T> getType()
        Specified by:
        getType in interface SocketHint<T>
      • getDomain

        public java.util.Optional<T[]> getDomain()
        Description copied from interface: SocketHint
        A hint at the range of values that this socket can hold. For numeric types, this can consist of two elements that correspond.
        Specified by:
        getDomain in interface SocketHint<T>
      • getTypeLabel

        public java.lang.String getTypeLabel()
        Description copied from interface: SocketHint
        A user-presentable string to represent the type of this socket. This may be empty.
        Specified by:
        getTypeLabel in interface SocketHint<T>
      • createInitialValue

        public java.util.Optional<T> createInitialValue()
        Description copied from interface: SocketHint
        Constructs the initial value if an initial value provider was supplied.
        Specified by:
        createInitialValue in interface SocketHint<T>
        Returns:
        Optionally, the initial value for the socket
      • isCompatibleWith

        public boolean isCompatibleWith​(SocketHint other)
        Description copied from interface: SocketHint
        Determines if this is able to contain the type of value that the other socket hint contains.
        Specified by:
        isCompatibleWith in interface SocketHint<T>
        Parameters:
        other - The other socket hint to check if this hint's type can contain it
        Returns:
        True the two can be connected together
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object