public class SpecificationFactory
extends java.lang.Object
Requirement
s and getting instances of Specification
sConstructor and Description |
---|
SpecificationFactory() |
Modifier and Type | Method and Description |
---|---|
static <A,B> Specification<A,B> |
create(java.lang.Class<? extends Specification<A,B>> clazz,
java.lang.Object... args)
Creates a
Specification instance from the args by converting them to String for the given Specification |
static <A,B> Specification<A,B> |
create(java.lang.Class<? extends Specification<A,B>> clazz,
java.lang.String... specs)
Creates a
Specification instance from a string array for the given Specification |
static Specification<?,?> |
empty()
Gets the empty
Specification |
static <A,B> Specification<A,B> |
fromNbt(java.lang.Class<? extends Specification<A,B>> clazz,
net.minecraft.nbt.CompoundNBT nbt)
Creates a
Specification implementation from given item CompoundNBT |
static java.lang.String[] |
getRequirementNames(java.lang.Class<? extends Specification<?,?>> clazz)
Gets all requirement names in the given
Specification |
static <A,B,C extends Specification<A,B>> |
register(java.lang.Class<C> clazz,
Requirement<A,B,?> requirement)
Register a new
Requirement for the given Specification |
static <A,B> java.util.List<Requirement<A,B,?>> |
requirements(java.lang.Class<? extends Specification<A,B>> specification,
java.lang.String spec)
Gets the list of
Requirement s created from the given spec for the specified Specification |
public static <A,B,C extends Specification<A,B>> void register(java.lang.Class<C> clazz, Requirement<A,B,?> requirement)
Requirement
for the given Specification
clazz
- The type being registered underrequirement
- The requirement being registeredpublic static <A,B> java.util.List<Requirement<A,B,?>> requirements(java.lang.Class<? extends Specification<A,B>> specification, java.lang.String spec)
Requirement
s created from the given spec for the specified Specification
specification
- The typespec
- The spec being parsedpublic static <A,B> Specification<A,B> create(java.lang.Class<? extends Specification<A,B>> clazz, java.lang.String... specs)
Specification
instance from a string array for the given Specification
clazz
- The typespecs
- The specs being parsedpublic static <A,B> Specification<A,B> create(java.lang.Class<? extends Specification<A,B>> clazz, java.lang.Object... args)
Specification
instance from the args by converting them to String for the given Specification
clazz
- The typeargs
- Args being convertedpublic static Specification<?,?> empty()
Specification
public static java.lang.String[] getRequirementNames(java.lang.Class<? extends Specification<?,?>> clazz)
Specification
clazz
- The typepublic static <A,B> Specification<A,B> fromNbt(java.lang.Class<? extends Specification<A,B>> clazz, net.minecraft.nbt.CompoundNBT nbt)
Specification
implementation from given item CompoundNBT
A
- The reforged typeB
- The minecraft typeclazz
- The typenbt
- The NBT data