java.lang.Object
com.binaris.wizardry.api.content.spell.properties.PropertyTypes

public final class PropertyTypes extends Object
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 Details

  • Method Details

    • addType

      public static <T> IPropertyType<T> addType(String id, IPropertyType<T> propertyType)
      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

      @Nullable public static @Nullable IPropertyType<?> getType(String id)
      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

      public static boolean hasType(String id)
      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

      public static Map<String,IPropertyType<?>> getAllTypes()
      Returns a map of all registered property types.
      Returns:
      A map where keys are property type identifiers and values are their corresponding implementations.