Package com.pixelmonmod.api
Class EmptySpecification
java.lang.Object
com.pixelmonmod.api.EmptySpecification
- All Implemented Interfaces:
Specification<Object,
,Object> Cloneable
Abn empty specification implementation that does nothing
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the specification data to the given object Will do nothing if the object is not of type A or Bcreate()
Creates an instance of the reforged data objectcreate
(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 defaultstatic EmptySpecification
<T> Optional<Requirement<Object,
Object, T>> getRequirement
(Class<? extends Requirement<Object, Object, T>> clazz) Attempts to get a requirement from the specification Will returnOptional.empty()
if not found<T> Set<Requirement<Object,
Object, T>> getRequirements
(Class<? extends Requirement<Object, Object, T>> clazz) Attempts to get a list of requirements from the specification<T> Optional<T>
getValue
(Class<? extends Requirement<Object, Object, T>> clazz) Attempts to get a value from the specification Will returnOptional.empty()
if not foundboolean
Checks if an object matches the specification data Will return false if the object is neither A or Bnet.minecraft.nbt.CompoundTag
write
(net.minecraft.nbt.CompoundTag nbt) Writes the specification to NBT
-
Method Details
-
matches
Description copied from interface:Specification
Checks if an object matches the specification data Will return false if the object is neither A or B- Specified by:
matches
in interfaceSpecification<Object,
Object> - Parameters:
o
- The object being checked- Returns:
- True if it matches the data - false otherwise
-
apply
Description copied from interface:Specification
Applies the specification data to the given object Will do nothing if the object is not of type A or B- Specified by:
apply
in interfaceSpecification<Object,
Object> - Parameters:
o
- The object being updated
-
write
public net.minecraft.nbt.CompoundTag write(net.minecraft.nbt.CompoundTag nbt) Description copied from interface:Specification
Writes the specification to NBT- Specified by:
write
in interfaceSpecification<Object,
Object> - Parameters:
nbt
- The NBT being written to- Returns:
- The updated NBT
-
getValue
Description copied from interface:Specification
Attempts to get a value from the specification Will returnOptional.empty()
if not found- Specified by:
getValue
in interfaceSpecification<Object,
Object> - Type Parameters:
T
- The type of the requirement- Parameters:
clazz
- The data type being searched for- Returns:
- Any found data
-
getRequirement
public <T> Optional<Requirement<Object,Object, getRequirementT>> (Class<? extends Requirement<Object, Object, T>> clazz) Description copied from interface:Specification
Attempts to get a requirement from the specification Will returnOptional.empty()
if not found- Specified by:
getRequirement
in interfaceSpecification<Object,
Object> - Type Parameters:
T
- The type of the requirement- Parameters:
clazz
- The data type being searched for- Returns:
- Any found data
-
getRequirements
public <T> Set<Requirement<Object,Object, getRequirementsT>> (Class<? extends Requirement<Object, Object, T>> clazz) Description copied from interface:Specification
Attempts to get a list of requirements from the specification- Specified by:
getRequirements
in interfaceSpecification<Object,
Object> - Type Parameters:
T
- The type of the requirement- Parameters:
clazz
- The data type being searched for- Returns:
- Any found data
-
create
Description copied from interface:Specification
Creates an instance of the reforged data object- Specified by:
create
in interfaceSpecification<Object,
Object> - Returns:
- An instance
-
create
Description copied from interface:Specification
Creates an instance of the reforged data object
If shallow is true not all fields will be instantiated - shallow should be false by default- Specified by:
create
in interfaceSpecification<Object,
Object> - Returns:
-
getInstance
-