Class PropertyTypes
java.lang.Object
com.binaris.wizardry.api.content.spell.properties.PropertyTypes
Registry class for different property types used in spell properties. This class maintains a mapping of property type
identifiers to their corresponding
IPropertyType implementations, allowing for easy retrieval and management
of various property types. It includes predefined property types for common primitive data types such as Byte, Short,
Integer, Long, Float, Double, Boolean, and String. Additional custom property types can be added as needed.
Adding new property types should be done using the addType(String, IPropertyType) method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyType<Boolean>static final PropertyType<Byte>static final PropertyType<Map<String,Boolean>> static final PropertyType<Double>static final PropertyType<Float>static final PropertyType<Integer>static final PropertyType<Long>static final PropertyType<Short>static final PropertyType<String> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IPropertyType<T>addType(String id, IPropertyType<T> propertyType) Registers a new property type with the given identifier.static Map<String,IPropertyType<?>> Returns a map of all registered property types.static @Nullable IPropertyType<?>Retrieves the property type associated with the given identifier.static booleanChecks if a property type with the given identifier is registered.
-
Field Details
-
BYTE
-
SHORT
-
INT
-
LONG
-
FLOAT
-
DOUBLE
-
BOOLEAN
-
STRING
-
CONTEXT_MAP
-
-
Method Details
-
addType
Registers a new property type with the given identifier.- Type Parameters:
T- The type of the property value.- Parameters:
id- The unique identifier for the property type.propertyType- The property type implementation to register.- Returns:
- The registered property type.
-
getType
Retrieves the property type associated with the given identifier.- Parameters:
id- The unique identifier for the property type.- Returns:
- The property type implementation, or null if not found.
-
hasType
Checks if a property type with the given identifier is registered.- Parameters:
id- The unique identifier for the property type.- Returns:
- True if the property type is registered, false otherwise.
-
getAllTypes
Returns a map of all registered property types.- Returns:
- A map where keys are property type identifiers and values are their corresponding implementations.
-