Package com.comphenix.protocol.error
Class Report
java.lang.Object
com.comphenix.protocol.error.Report
Represents a error or warning report.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMust be constructed through the factory method in Report. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedReport(ReportType type, Throwable exception, Object[] messageParameters, Object[] callerParameters) Construct a new report with the given type and parameters.protectedReport(ReportType type, Throwable exception, Object[] messageParameters, Object[] callerParameters, long rateLimit) Construct a new report with the given type and parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanObject[]Retrieve the parameters of the caller method.Retrieve the associated exception, or NULL if not found.Object[]Retrieve the message parameters that will be used to construc the report message.longRetrieve desired minimum number of nanoseconds until a report of the same type and parameters should be reprinted.Format the current report type with the provided message parameters.getType()Retrieve the report type.booleanDetermine if we have any caller parameters.inthashCode()booleanDetermine if we have any message parameters.static Report.ReportBuildernewBuilder(ReportType type) Construct a new report builder.
-
Constructor Details
-
Report
protected Report(ReportType type, @Nullable Throwable exception, @Nullable Object[] messageParameters, @Nullable Object[] callerParameters) Construct a new report with the given type and parameters.- Parameters:
type- - the report type that will be used to construct the message.exception- - exception that occured in the caller method.messageParameters- - parameters used to construct the report message.callerParameters- - parameters from the caller method.
-
Report
protected Report(ReportType type, @Nullable Throwable exception, @Nullable Object[] messageParameters, @Nullable Object[] callerParameters, long rateLimit) Construct a new report with the given type and parameters.- Parameters:
type- - the report type that will be used to construct the message.exception- - exception that occurred in the caller method.messageParameters- - parameters used to construct the report message.callerParameters- - parameters from the caller method.rateLimit- - minimum number of nanoseconds to wait until a report of equal type and parameters is allowed to be printed again.
-
-
Method Details
-
newBuilder
Construct a new report builder.- Parameters:
type- - the initial report type.- Returns:
- Report builder.
-
getReportMessage
Format the current report type with the provided message parameters.- Returns:
- The formated report message.
-
getMessageParameters
Retrieve the message parameters that will be used to construc the report message.This should not be confused with the method parameters of the caller method.
- Returns:
- Message parameters.
-
getCallerParameters
Retrieve the parameters of the caller method. Optional - may be NULL.- Returns:
- Parameters or the caller method.
-
getType
Retrieve the report type.- Returns:
- Report type.
-
getException
Retrieve the associated exception, or NULL if not found.- Returns:
- Associated exception, or NULL.
-
hasMessageParameters
public boolean hasMessageParameters()Determine if we have any message parameters.- Returns:
- TRUE if there are any message parameters, FALSE otherwise.
-
hasCallerParameters
public boolean hasCallerParameters()Determine if we have any caller parameters.- Returns:
- TRUE if there are any caller parameters, FALSE otherwise.
-
getRateLimit
public long getRateLimit()Retrieve desired minimum number of nanoseconds until a report of the same type and parameters should be reprinted.Note that this may be ignored or modified by the error reporter. Zero indicates no rate limit.
- Returns:
- The number of nanoseconds. Never negative.
-
hashCode
public int hashCode() -
equals
-