Package net.minecraftforge.common.util
Record Class LogMessageAdapter
java.lang.Object
java.lang.Record
net.minecraftforge.common.util.LogMessageAdapter
- All Implemented Interfaces:
Serializable
,org.apache.logging.log4j.message.Message
,org.apache.logging.log4j.util.StringBuilderFormattable
public record LogMessageAdapter(Consumer<StringBuilder> builder)
extends Record
implements org.apache.logging.log4j.message.Message, org.apache.logging.log4j.util.StringBuilderFormattable
- See Also:
- Serialized Form
-
Field Summary
Modifier and TypeFieldDescriptionprivate Consumer<StringBuilder>
The field for thebuilder
record component.private static Object[]
-
Constructor Summary
ConstructorDescriptionLogMessageAdapter(Consumer<StringBuilder> builder)
Creates an instance of aLogMessageAdapter
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.logging.log4j.message.Message
adapt(Consumer<StringBuilder> toConsume)
builder()
Returns the value of thebuilder
record component.boolean
Indicates whether some other object is "equal to" this one.void
formatTo(StringBuilder buffer)
Object[]
int
hashCode()
Returns a hash code value for this object.toString()
Returns a string representation of this record class.
-
Field Details
-
builder
The field for thebuilder
record component. -
EMPTY
-
-
Constructor Details
-
LogMessageAdapter
Creates an instance of aLogMessageAdapter
record class.- Parameters:
builder
- the value for thebuilder
record component
-
-
Method Details
-
getFormattedMessage
- Specified by:
getFormattedMessage
in interfaceorg.apache.logging.log4j.message.Message
-
getFormat
- Specified by:
getFormat
in interfaceorg.apache.logging.log4j.message.Message
-
getParameters
- Specified by:
getParameters
in interfaceorg.apache.logging.log4j.message.Message
-
getThrowable
- Specified by:
getThrowable
in interfaceorg.apache.logging.log4j.message.Message
-
formatTo
- Specified by:
formatTo
in interfaceorg.apache.logging.log4j.util.StringBuilderFormattable
-
adapt
-
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)
. -
builder
Returns the value of thebuilder
record component.- Returns:
- the value of the
builder
record component
-