Class NegateNext


  • public final class NegateNext
    extends Object
    Represents a utility class for managing a "negate next" boolean flag. This flag is often used to dictate whether the next operation should be negated. The class provides methods to toggle the state of the flag and query its current value.

    The state of this flag can be changed dynamically using the provided applyNegateNext method. This functionality is commonly used in scenarios where conditional logic needs to be applied based on whether negation is enabled or disabled.

    Instances of this class are designed for simple and stateless operations around the "negate next" flag.
    • Constructor Detail

      • NegateNext

        public NegateNext()
    • Method Detail

      • applyNegateNext

        public void applyNegateNext()
        Toggles the "negate next" flag, reversing its current state. If the flag is currently set to true, invoking this method will change it to false, and vice versa. This method is typically used as part of a sequence of operations where subsequent behavior depends on whether a negation is applied.
      • isNegateNext

        public boolean isNegateNext()
        Checks if the "negate next" flag is currently set.
        Returns:
        true if the "negate next" flag is set, false otherwise
      • toString

        public String toString()
        Returns a string representation of the "NegateNext" object, including the current state of the "negateNext" flag.
        Overrides:
        toString in class Object
        Returns:
        a string in the format "NegateNext{negateNext=state}", where state is the current boolean value of the "negateNext" flag