Class WeightedSerializableObject<T extends DataSerializable>
java.lang.Object
org.spongepowered.api.util.weighted.TableEntry<T>
org.spongepowered.api.util.weighted.WeightedObject<T>
org.spongepowered.api.util.weighted.WeightedSerializableObject<T>
- Type Parameters:
T- The entry type
- All Implemented Interfaces:
DataSerializable
public class WeightedSerializableObject<T extends DataSerializable>
extends WeightedObject<T>
implements DataSerializable
An entry which contains an object with the added restriction that the object
be serializable.
-
Constructor Summary
ConstructorsConstructorDescriptionWeightedSerializableObject(T object, int weight) Creates a newWeightedSerializableObjectwith the providedDataSerializable. -
Method Summary
Modifier and TypeMethodDescriptionintGets the content version of thisDataSerializable.booleanSerializes this object into a comprehensibleDataContainer.toString()Methods inherited from class org.spongepowered.api.util.weighted.WeightedObject
get, hashCodeMethods inherited from class org.spongepowered.api.util.weighted.TableEntry
weight
-
Constructor Details
-
WeightedSerializableObject
Creates a newWeightedSerializableObjectwith the providedDataSerializable.- Parameters:
object- The serializable objectweight- The weight
-
-
Method Details
-
toString
- Overrides:
toStringin classWeightedObject<T extends DataSerializable>
-
equals
- Overrides:
equalsin classWeightedObject<T extends DataSerializable>
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializableGets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromDataSerializable.toContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Specified by:
contentVersionin interfaceDataSerializable- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
toContainerin interfaceDataSerializable- Returns:
- A newly created DataContainer
-