Class Acceptor

  • All Implemented Interfaces:
    ToNode

    public final class Acceptor
    extends java.lang.Object
    implements ToNode
    Represents an acceptor in a waiter's state machine.
    • Constructor Detail

      • Acceptor

        public Acceptor​(AcceptorState state,
                        Matcher<?> matcher)
        Parameters:
        state - State the acceptor transitions to when matched.
        matcher - The matcher to match against.
    • Method Detail

      • getState

        public AcceptorState getState()
        Gets the state to transition to if matched.
        Returns:
        Acceptor state to transition to.
      • getMatcher

        public Matcher<?> getMatcher()
        Gets the matcher used to test if the acceptor.
        Returns:
        Returns the matcher.
      • fromNode

        public static Acceptor fromNode​(Node node)
        Creates an Acceptor from a Node.
        Parameters:
        node - Node to create the Acceptor from.
        Returns:
        Returns the created Acceptor.
        Throws:
        ExpectationNotMetException - if the given Node is invalid.
      • toNode

        public Node toNode()
        Description copied from interface: ToNode
        Converts a value to a Node.
        Specified by:
        toNode in interface ToNode
        Returns:
        Returns the creates Node.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object