Class ErrorDirective

java.lang.Object
com.yahoo.messagebus.routing.ErrorDirective
All Implemented Interfaces:
HopDirective

public class ErrorDirective extends Object implements HopDirective
This class represents an error directive within a Hop's selector. This means to stop whatever is being resolved, and instead return a reply containing a specified error.
Author:
Simon Thoresen Hult
  • Constructor Details

    • ErrorDirective

      public ErrorDirective(String msg)
      Constructs a new error directive.
      Parameters:
      msg - The error message.
  • Method Details

    • getMessage

      public String getMessage()
      Returns the error string that is to be assigned to the reply.
      Returns:
      The error string.
    • matches

      public boolean matches(HopDirective dir)
      Description copied from interface: HopDirective
      Returns true if this directive matches another.
      Specified by:
      matches in interface HopDirective
      Parameters:
      dir - The directive to compare this to.
      Returns:
      True if this matches the argument.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDebugString

      public String toDebugString()
      Description copied from interface: HopDirective
      Returns a string representation of this that can be debugged but not parsed.
      Specified by:
      toDebugString in interface HopDirective
      Returns:
      The debug string.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object