Class FeatureError
- java.lang.Object
-
- com.opencloud.sentinel.feature.spi.FeatureError
-
- All Implemented Interfaces:
com.opencloud.util.FastSerializable
,java.io.Serializable
public final class FeatureError extends java.lang.Object implements java.io.Serializable, com.opencloud.util.FastSerializable
Represents an error that occurred in the Feature- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FeatureError.Cause
-
Constructor Summary
Constructors Constructor Description FeatureError(FeatureError.Cause cause)
Create a feature error with an associated causeFeatureError(FeatureError.Cause cause, java.lang.String explanation)
Create a feature error with an associated cause and explanationFeatureError(FeatureError.Cause cause, java.lang.String explanation, java.lang.Throwable associatedThrowable)
Create a feature error with an associated cause, an explanation and an associated exceptionFeatureError(java.io.DataInput in)
Deserialise a FastSerialized FeatureWarning.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getAssociatedThrowableStacktrace()
FeatureError.Cause
getCause()
java.lang.String
getExplanation()
boolean
hasAssociatedThrowableStacktrace()
boolean
hasExplanation()
void
toStream(java.io.DataOutput stream)
java.lang.String
toString()
-
-
-
Constructor Detail
-
FeatureError
public FeatureError(FeatureError.Cause cause)
Create a feature error with an associated cause- Parameters:
cause
- the cause of the error
-
FeatureError
public FeatureError(FeatureError.Cause cause, java.lang.String explanation)
Create a feature error with an associated cause and explanation- Parameters:
cause
- the cause of the errorexplanation
- description of the error
-
FeatureError
public FeatureError(FeatureError.Cause cause, java.lang.String explanation, java.lang.Throwable associatedThrowable)
Create a feature error with an associated cause, an explanation and an associated exception- Parameters:
cause
- the cause of the errorexplanation
- description of the errorassociatedThrowable
- an exception related to the error
-
FeatureError
public FeatureError(java.io.DataInput in) throws java.io.IOException
Deserialise a FastSerialized FeatureWarning. FastSerialize on this class does not store the associated throwable- Parameters:
in
- input stream.- Throws:
java.io.IOException
-
-
Method Detail
-
getCause
public FeatureError.Cause getCause()
- Returns:
- the cause of the error
-
hasExplanation
public boolean hasExplanation()
- Returns:
- true if there is an explanation
-
getExplanation
public java.lang.String getExplanation()
- Returns:
- the explanation
-
hasAssociatedThrowableStacktrace
public boolean hasAssociatedThrowableStacktrace()
- Returns:
- true if there was a throwable associated with the error
-
getAssociatedThrowableStacktrace
public java.lang.String getAssociatedThrowableStacktrace()
- Returns:
- a string representation of the stack trace of the throwable associated with the error
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStream
public void toStream(java.io.DataOutput stream) throws java.io.IOException
- Specified by:
toStream
in interfacecom.opencloud.util.FastSerializable
- Throws:
java.io.IOException
-
-