Record Class FormattingContext
java.lang.Object
java.lang.Record
com.blamejared.searchables.api.formatter.FormattingContext
- Record Components:
isKey- Is the current expression a keystyle- The style to apply to the current expressionvalid- If the current expression is valid.
public record FormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid)
extends Record
Extra context used by the
FormattingVisitor.-
Constructor Summary
ConstructorsConstructorDescriptionFormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid) Creates an instance of aFormattingContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic FormattingContextempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisKey()Returns the value of theisKeyrecord component.static FormattingContextkey(net.minecraft.network.chat.Style validStyle, boolean valid) static FormattingContextliteral(net.minecraft.network.chat.Style validStyle, boolean valid) net.minecraft.network.chat.Stylestyle()Returns the value of thestylerecord component.net.minecraft.network.chat.Stylestyle(boolean valid) final StringtoString()Returns a string representation of this record class.booleanvalid()Returns the value of thevalidrecord component.
-
Constructor Details
-
FormattingContext
public FormattingContext(boolean isKey, net.minecraft.network.chat.Style style, boolean valid) Creates an instance of aFormattingContextrecord class.
-
-
Method Details
-
empty
-
key
-
literal
-
style
public net.minecraft.network.chat.Style style(boolean valid) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
isKey
public boolean isKey()Returns the value of theisKeyrecord component.- Returns:
- the value of the
isKeyrecord component
-
style
public net.minecraft.network.chat.Style style()Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-
valid
public boolean valid()Returns the value of thevalidrecord component.- Returns:
- the value of the
validrecord component
-