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.FastSerializableRepresents an error that occurred in the Feature- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFeatureError.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 booleanequals(java.lang.Object o)java.lang.StringgetAssociatedThrowableStacktrace()FeatureError.CausegetCause()java.lang.StringgetExplanation()booleanhasAssociatedThrowableStacktrace()booleanhasExplanation()voidtoStream(java.io.DataOutput stream)java.lang.StringtoString()
-
-
-
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.IOExceptionDeserialise 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:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStream
public void toStream(java.io.DataOutput stream) throws java.io.IOException- Specified by:
toStreamin interfacecom.opencloud.util.FastSerializable- Throws:
java.io.IOException
-
-