public class EmptySpecification extends java.lang.Object implements Specification<java.lang.Object,java.lang.Object>
Modifier and Type | Field and Description |
---|---|
static EmptySpecification |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
apply(java.lang.Object o)
Applies the specification data to the given object
Will do nothing if the object is not of type A or B
|
java.lang.Object |
create()
Creates an instance of the reforged data object
|
java.lang.Object |
create(boolean shallow)
Creates an instance of the reforged data object
If shallow is true not all fields will be instantiated - shallow should be false by default
|
<T> java.util.Optional<T> |
getValue(java.lang.Class<? extends Requirement<java.lang.Object,java.lang.Object,T>> clazz)
Attempts to get a value from the specification
Will return
Optional.empty() if not found |
boolean |
matches(java.lang.Object o)
Checks if an object matches the specification data
Will return false if the object is neither A or B
|
net.minecraft.nbt.NBTTagCompound |
write(net.minecraft.nbt.NBTTagCompound nbt)
Writes the specification to NBT
|
public static EmptySpecification INSTANCE
public boolean matches(java.lang.Object o)
Specification
matches
in interface Specification<java.lang.Object,java.lang.Object>
o
- The object being checkedpublic void apply(java.lang.Object o)
Specification
apply
in interface Specification<java.lang.Object,java.lang.Object>
o
- The object being updatedpublic java.lang.Object create()
Specification
create
in interface Specification<java.lang.Object,java.lang.Object>
public java.lang.Object create(boolean shallow)
Specification
create
in interface Specification<java.lang.Object,java.lang.Object>
public net.minecraft.nbt.NBTTagCompound write(net.minecraft.nbt.NBTTagCompound nbt)
Specification
write
in interface Specification<java.lang.Object,java.lang.Object>
nbt
- The NBT being written topublic <T> java.util.Optional<T> getValue(java.lang.Class<? extends Requirement<java.lang.Object,java.lang.Object,T>> clazz)
Specification
Optional.empty()
if not foundgetValue
in interface Specification<java.lang.Object,java.lang.Object>
T
- The type of the requirementclazz
- The data type being searched for