Class Report

java.lang.Object
com.comphenix.protocol.error.Report

public class Report extends Object
Represents a error or warning report.
  • 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

      public static Report.ReportBuilder newBuilder(ReportType type)
      Construct a new report builder.
      Parameters:
      type - - the initial report type.
      Returns:
      Report builder.
    • getReportMessage

      public String getReportMessage()
      Format the current report type with the provided message parameters.
      Returns:
      The formated report message.
    • getMessageParameters

      public Object[] 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

      public Object[] getCallerParameters()
      Retrieve the parameters of the caller method. Optional - may be NULL.
      Returns:
      Parameters or the caller method.
    • getType

      public ReportType getType()
      Retrieve the report type.
      Returns:
      Report type.
    • getException

      public Throwable 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()
      Overrides:
      hashCode in class Object
    • equals

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