Class Property


  • public class Property
    extends Object
    Store some default properties of this framework.
    • Method Detail

      • hasKey

        public static boolean hasKey​(String key)
        Indicate whether it has the key or not
        Parameters:
        key - the FocessQQ framework properties' key
        Returns:
        true if it has the key, false otherwise
      • put

        public static void put​(String key,
                               Object value)
        Set the property
        Parameters:
        key - the FocessQQ framework properties' key
        value - the FocessQQ framework properties' value
      • get

        public static <T> T get​(String key)
        Get the value of the key in the properties
        Type Parameters:
        T - the value type
        Parameters:
        key - the FocessQQ framework properties' key
        Returns:
        the value
        Throws:
        ClassCastException - if the value is not the specified type
      • getOrDefault

        public static <T> T getOrDefault​(String key,
                                         T t)
        Get the value of the key in the properties or default value if the key is not existed
        Type Parameters:
        T - the value type
        Parameters:
        key - the FocessQQ framework properties' key
        t - the default value
        Returns:
        the value, or the default value if there is no value
      • remove

        public static void remove​(String key)
        Remove the property
        Parameters:
        key - the FocessQQ framework properties' key