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 theformatterrecord component.The field for thevalueClassrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCustomFormat(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunction<T> formatter) privateCustomFormat(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunctionWithArgs<T> formatter) Creates an instance of aCustomFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theformatterrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueClassrecord component.
-
Field Details
-
valueClass
The field for thevalueClassrecord component. -
formatter
The field for theformatterrecord component.
-
-
Constructor Details
-
CustomFormat
-
CustomFormat
private CustomFormat(Class<T> valueClass, FMLTranslations.CustomFormat.FormatFunctionWithArgs<T> formatter) Creates an instance of aCustomFormatrecord class.- Parameters:
valueClass- the value for thevalueClassrecord componentformatter- the value for theformatterrecord component
-
-
Method Details
-
getFormat
- Specified by:
getFormatin 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 thevalueClassrecord component.- Returns:
- the value of the
valueClassrecord component
-
formatter
Returns the value of theformatterrecord component.- Returns:
- the value of the
formatterrecord component
-