Package org.spongepowered.asm.service
Interface IGlobalPropertyService
-
public interface IGlobalPropertyServiceGlobal property service
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TgetProperty(IPropertyKey key)Get a value from the global property store (blackboard) and duck-type it to the specified type<T> TgetProperty(IPropertyKey key, T defaultValue)Get the value from the global property store (blackboard) but return defaultValue if the specified key is not set.java.lang.StringgetPropertyString(IPropertyKey key, java.lang.String defaultValue)Get a string from the global property store (blackboard), returns default value if not set or null.IPropertyKeyresolveKey(java.lang.String name)Resolve a property key from the service by namevoidsetProperty(IPropertyKey key, java.lang.Object value)Set the specified value in the global property store (blackboard)
-
-
-
Method Detail
-
resolveKey
IPropertyKey resolveKey(java.lang.String name)
Resolve a property key from the service by name- Parameters:
name- name of key to resolve- Returns:
- resolved key
-
getProperty
<T> T getProperty(IPropertyKey key)
Get a value from the global property store (blackboard) and duck-type it to the specified type- Type Parameters:
T- duck type- Parameters:
key- blackboard key- Returns:
- value
-
setProperty
void setProperty(IPropertyKey key, java.lang.Object value)
Set the specified value in the global property store (blackboard)- Parameters:
key- blackboard keyvalue- new value
-
getProperty
<T> T getProperty(IPropertyKey key, T defaultValue)
Get the value from the global property store (blackboard) but return defaultValue if the specified key is not set.- Type Parameters:
T- duck type- Parameters:
key- blackboard keydefaultValue- value to return if the key is not set or is null- Returns:
- value from blackboard or default value
-
getPropertyString
java.lang.String getPropertyString(IPropertyKey key, java.lang.String defaultValue)
Get a string from the global property store (blackboard), returns default value if not set or null.- Parameters:
key- blackboard keydefaultValue- default value to return if the specified key is not set or is null- Returns:
- value from blackboard or default
-
-