Record Class SavedData.Factory<T extends SavedData>
java.lang.Object
java.lang.Record
net.minecraft.world.level.saveddata.SavedData.Factory<T>
- Enclosing class:
- SavedData
public static record SavedData.Factory<T extends SavedData>(Supplier<T extends SavedData> constructor, Function<CompoundTag,T extends SavedData> deserializer, @Nullable DataFixTypes type)
extends Record 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for theconstructorrecord component.private final Function<CompoundTag,T> The field for thedeserializerrecord component.private final DataFixTypesThe field for thetyperecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionFactory(Supplier<T> constructor, Function<CompoundTag, T> deserializer, DataFixTypes type) Creates an instance of aFactoryrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the value of theconstructorrecord component.Returns the value of thedeserializerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
- 
Field Details- 
constructorThe field for theconstructorrecord component.
- 
deserializerThe field for thedeserializerrecord component.
- 
typeThe field for thetyperecord component.
 
- 
- 
Constructor Details- 
Factory
- 
Factorypublic Factory(Supplier<T> constructor, Function<CompoundTag, T> deserializer, @Nullable DataFixTypes type) Creates an instance of aFactoryrecord class.- Parameters:
- constructor- the value for the- constructorrecord component
- deserializer- the value for the- deserializerrecord component
- type- the value for the- typerecord component
 
 
- 
- 
Method Details- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
constructorReturns the value of theconstructorrecord component.- Returns:
- the value of the constructorrecord component
 
- 
deserializerReturns the value of thedeserializerrecord component.- Returns:
- the value of the deserializerrecord component
 
- 
typeReturns the value of thetyperecord component.- Returns:
- the value of the typerecord component
 
 
-