Class GlobalProperties

java.lang.Object
org.spongepowered.asm.launch.GlobalProperties

public final class GlobalProperties extends Object
Access to underlying global property service provided by the current environment
  • Method Details

    • get

      public static <T> T get(GlobalProperties.Keys key)
      Get a value from the blackboard and duck-type it to the specified type
      Type Parameters:
      T - duck type
      Parameters:
      key - blackboard key
      Returns:
      value
    • put

      public static void put(GlobalProperties.Keys key, Object value)
      Put the specified value onto the blackboard
      Parameters:
      key - blackboard key
      value - new value
    • get

      public static <T> T get(GlobalProperties.Keys key, T defaultValue)
      Get the value from the blackboard but return defaultValue if the specified key is not set.
      Type Parameters:
      T - duck type
      Parameters:
      key - blackboard key
      defaultValue - value to return if the key is not set or is null
      Returns:
      value from blackboard or default value
    • getString

      public static String getString(GlobalProperties.Keys key, String defaultValue)
      Get a string from the blackboard, returns default value if not set or null.
      Parameters:
      key - blackboard key
      defaultValue - default value to return if the specified key is not set or is null
      Returns:
      value from blackboard or default