Record Class RuntimeError
java.lang.Object
java.lang.Record
org.skriptlang.skript.log.runtime.RuntimeError
- Record Components:
level- The severity (warning or severe)source- The source of the errorerror- The message to display as the errortoHighlight- Optionally, the text within the emitting line to highlight. This should be treated as a regex pattern and will highlight the first match it finds.
public record RuntimeError(Level level, ErrorSource source, String error, @Nullable String toHighlight)
extends Record
Represents a single instance of a runtime error.
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeError(Level level, ErrorSource source, String error, @Nullable String toHighlight) Creates an instance of aRuntimeErrorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.source()Returns the value of thesourcerecord component.@Nullable StringReturns the value of thetoHighlightrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RuntimeError
public RuntimeError(Level level, ErrorSource source, String error, @Nullable @Nullable String toHighlight) Creates an instance of aRuntimeErrorrecord class.- Parameters:
level- the value for thelevelrecord componentsource- the value for thesourcerecord componenterror- the value for theerrorrecord componenttoHighlight- the value for thetoHighlightrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
toHighlight
Returns the value of thetoHighlightrecord component.- Returns:
- the value of the
toHighlightrecord component
-