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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the property info for the given actual class.getHandler
(Class<?> inputClass) Get the appropriate handler for the given input class.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
PropertyMap
public PropertyMap()
-
-
Method Details
-
getHandler
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
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.
-