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 SummaryConstructorsConstructorDescriptionWeightedSerializableObject(T object, int weight) Creates a newWeightedSerializableObjectwith the providedDataSerializable.
- 
Method SummaryModifier and TypeMethodDescriptionintGets the content version of thisDataSerializable.booleanSerializes this object into a comprehensibleDataContainer.toString()Methods inherited from class org.spongepowered.api.util.weighted.WeightedObjectget, hashCodeMethods inherited from class org.spongepowered.api.util.weighted.TableEntryweight
- 
Constructor Details- 
WeightedSerializableObjectCreates a newWeightedSerializableObjectwith the providedDataSerializable.- Parameters:
- object- The serializable object
- weight- The weight
 
 
- 
- 
Method Details- 
toString- Overrides:
- toStringin class- WeightedObject<T extends DataSerializable>
 
- 
equals- Overrides:
- equalsin class- WeightedObject<T extends DataSerializable>
 
- 
contentVersionpublic 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 interface- DataSerializable
- Returns:
- The version of the content being serialized
 
- 
toContainerDescription copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
- toContainerin interface- DataSerializable
- Returns:
- A newly created DataContainer
 
 
-