Class EmptyObject<T>
- java.lang.Object
-
- org.spongepowered.api.util.weighted.TableEntry<T>
-
- org.spongepowered.api.util.weighted.EmptyObject<T>
-
- Type Parameters:
T
- The type of object of this entries table
- All Implemented Interfaces:
DataSerializable
public class EmptyObject<T> extends TableEntry<T> implements DataSerializable
Represents an entry in a table which has no associated object. Used to have rolls which give nothing.
-
-
Constructor Summary
Constructors Constructor Description EmptyObject(double weight)
Creates a newEmptyObject
with the given weight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
contentVersion()
Gets the content version of thisDataSerializable
.boolean
equals(Object o)
int
hashCode()
DataContainer
toContainer()
Serializes this object into a comprehensibleDataContainer
.String
toString()
-
Methods inherited from class org.spongepowered.api.util.weighted.TableEntry
weight
-
-
-
-
Constructor Detail
-
EmptyObject
public EmptyObject(double weight)
Creates a newEmptyObject
with the given weight.- Parameters:
weight
- The weight of this object
-
-
Method Detail
-
contentVersion
public int contentVersion()
Description copied from interface:DataSerializable
Gets the content version of thisDataSerializable
. The version may differ between instances of plugins and implementations such that theDataView
fromDataSerializable.toContainer()
may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdater
as it is required when there exists anyDataView
of thisDataSerializable
with an "older" version.- Specified by:
contentVersion
in interfaceDataSerializable
- Returns:
- The version of the content being serialized
-
toContainer
public DataContainer toContainer()
Description copied from interface:DataSerializable
Serializes this object into a comprehensibleDataContainer
.- Specified by:
toContainer
in interfaceDataSerializable
- Returns:
- A newly created DataContainer
-
-