Package com.yahoo.messagebus.routing
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 aHop
's selector. This means to stop whatever is being resolved, and instead return a reply containing a specified error.- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description ErrorDirective(String msg)
Constructs a new error directive.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getMessage()
Returns the error string that is to be assigned to the reply.int
hashCode()
boolean
matches(HopDirective dir)
Returns true if this directive matches another.String
toDebugString()
Returns a string representation of this that can be debugged but not parsed.String
toString()
-
-
-
Constructor Detail
-
ErrorDirective
public ErrorDirective(String msg)
Constructs a new error directive.- Parameters:
msg
- The error message.
-
-
Method Detail
-
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 interfaceHopDirective
- Parameters:
dir
- The directive to compare this to.- Returns:
- True if this matches the argument.
-
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 interfaceHopDirective
- Returns:
- The debug string.
-
-