Package com.comphenix.protocol.error
Class ReportType
java.lang.Object
com.comphenix.protocol.error.ReportType
Represents a strongly-typed report. Subclasses should be immutable.
By convention, a report must be declared as a static field publicly accessible from the sender class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMessage(Object[] parameters) Convert the given report to a string, using the provided parameters.static StringgetReportName(Object sender, ReportType type) Retrieve the full canonical name of a given report type.static ReportType[]getReports(Class<?> sender) Retrieve all publicly associated reports.static Class<?> getSenderClass(Object sender) Retrieve the class of the given sender.toString()
-
Field Details
-
reportName
-
-
Constructor Details
-
ReportType
Construct a new report type.- Parameters:
errorFormat- - string used to format the underlying report.
-
-
Method Details
-
getMessage
Convert the given report to a string, using the provided parameters.- Parameters:
parameters- - parameters to insert, or NULL to insert nothing.- Returns:
- The full report in string format.
-
toString
-
getSenderClass
Retrieve the class of the given sender.If the sender is already a Class, we return it.
- Parameters:
sender- - the sender to look up.- Returns:
- The class of the sender.
-
getReportName
Retrieve the full canonical name of a given report type.Note that the sender may be a class (for static callers), in which case it will be used directly instead of its getClass() method.
It is thus not advisable for class classes to report reports.
- Parameters:
sender- - the sender, or its class.type- - the report type.- Returns:
- The full canonical name.
-
getReports
Retrieve all publicly associated reports.- Parameters:
sender- - sender class.- Returns:
- All associated reports.
-