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.
public record RuntimeError(Level level, ErrorSource source, String error, @Nullable String toHighlight)
extends Record
Represents a single instance of a runtime error.
-
Constructor Summary
ConstructorDescriptionRuntimeError
(Level level, ErrorSource source, String error, @Nullable String toHighlight) Creates an instance of aRuntimeError
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.error()
Returns the value of theerror
record component.final int
hashCode()
Returns a hash code value for this object.level()
Returns the value of thelevel
record component.source()
Returns the value of thesource
record component.@Nullable String
Returns the value of thetoHighlight
record component.final String
toString()
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 aRuntimeError
record class.- Parameters:
level
- the value for thelevel
record componentsource
- the value for thesource
record componenterror
- the value for theerror
record componenttoHighlight
- the value for thetoHighlight
record 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 thelevel
record component.- Returns:
- the value of the
level
record component
-
source
Returns the value of thesource
record component.- Returns:
- the value of the
source
record component
-
error
Returns the value of theerror
record component.- Returns:
- the value of the
error
record component
-
toHighlight
Returns the value of thetoHighlight
record component.- Returns:
- the value of the
toHighlight
record component
-