Class PropertyMap<Handler extends PropertyHandler<?>>

java.lang.Object
java.util.AbstractMap<Class<?>,Property.PropertyInfo<Handler>>
java.util.HashMap<Class<?>,Property.PropertyInfo<Handler>>
org.skriptlang.skript.lang.properties.PropertyMap<Handler>
Type Parameters:
Handler - The type of PropertyHandler.
All Implemented Interfaces:
Serializable, Cloneable, Map<Class<?>,Property.PropertyInfo<Handler>>

@Experimental public class PropertyMap<Handler extends PropertyHandler<?>> extends HashMap<Class<?>,Property.PropertyInfo<Handler>>
A map of property handlers for different classes. Useful for storing which classes have which property handlers. Caches the closest matching class for faster lookup.
See Also:
  • Constructor Details

    • PropertyMap

      public PropertyMap()
  • Method Details

    • getHandler

      @Nullable public Handler getHandler(Class<?> inputClass)
      Get the appropriate handler for the given input class. This method will find the closest matching class in the map that is assignable from the actual class. The result is cached for faster lookup next time.
      Parameters:
      inputClass - the class to get the handler for
      Returns:
      the handler for the given class, or null if no handler is found
    • get

      public Property.PropertyInfo<Handler> get(Class<?> actualClass)
      Get the property info for the given actual class. This method will find the closest matching class in the map that is assignable from the actual class. The result is cached for faster lookup next time.
      Parameters:
      actualClass - The actual class to get the property info for.
      Returns:
      The property info for the given class, or null if no property info is found.