Package net.neoforged.fml.i18n
Record Class FMLTranslations.CustomFormat<T>
java.lang.Object
java.lang.Record
net.neoforged.fml.i18n.FMLTranslations.CustomFormat<T>
- All Implemented Interfaces:
org.apache.commons.lang3.text.FormatFactory
- Enclosing class:
FMLTranslations
private static record FMLTranslations.CustomFormat<T>(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunctionWithArgs<T> formatter)
extends Record
implements org.apache.commons.lang3.text.FormatFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FMLTranslations.CustomFormat.FormatFunctionWithArgs
<T> The field for theformatter
record component.The field for thevalueClass
record component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCustomFormat
(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunction<T> formatter) private
CustomFormat
(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunctionWithArgs<T> formatter) Creates an instance of aCustomFormat
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of theformatter
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Returns the value of thevalueClass
record component.
-
Field Details
-
valueClass
The field for thevalueClass
record component. -
formatter
The field for theformatter
record component.
-
-
Constructor Details
-
CustomFormat
-
CustomFormat
private CustomFormat(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunctionWithArgs<T> formatter) Creates an instance of aCustomFormat
record class.- Parameters:
valueClass
- the value for thevalueClass
record componentformatter
- the value for theformatter
record component
-
-
Method Details
-
getFormat
- Specified by:
getFormat
in interfaceorg.apache.commons.lang3.text.FormatFactory
-
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)
. -
valueClass
Returns the value of thevalueClass
record component.- Returns:
- the value of the
valueClass
record component
-
formatter
Returns the value of theformatter
record component.- Returns:
- the value of the
formatter
record component
-