Class TypedProperties

    • Constructor Detail

      • TypedProperties

        protected TypedProperties()
    • Method Detail

      • contains

        public abstract boolean contains​(String key)
        Check if the property identified by the key exists.
      • contains

        public boolean contains​(Enum<?> key)
        Equivalent to contains (key.name()).
      • getBoolean

        public abstract boolean getBoolean​(String key,
                                           boolean defaultValue)
        Get the value of the property identified by the key as boolean. If key is null or there is no property for the key, defaultValue is returned.
      • get

        public boolean get​(String key,
                           boolean defaultValue)
        Equivalent to getBoolean(key, defaultValue).
      • getBoolean

        public boolean getBoolean​(String key)
        Equivalent to getBoolean(key, false).
      • getBoolean

        public boolean getBoolean​(Enum<?> key,
                                  boolean defaultValue)
        Equivalent to getBoolean(key.name(), defaultValue). If key is null, defaultValue is returned.
      • get

        public boolean get​(Enum<?> key,
                           boolean defaultValue)
        Equivalent to getBoolean(key, defaultValue).
      • getBoolean

        public boolean getBoolean​(Enum<?> key)
        Equivalent to getBoolean(key.name()). if key is null, false is returned.
      • getFloat

        public abstract float getFloat​(String key,
                                       float defaultValue)
        Get the value of the property identified by the key as float. If key is null or there is no property for the key, defaultValue is returned.
      • get

        public float get​(String key,
                         float defaultValue)
        Equivalent to getFloat(key, defaultValue).
      • getFloat

        public float getFloat​(String key)
        Equivalent to getFloat(key, 0.0F).
      • getFloat

        public float getFloat​(Enum<?> key,
                              float defaultValue)
        Equivalent to getFloat(key.name(), defaultValue). If key is null, defaultValue is returned.
      • get

        public float get​(Enum<?> key,
                         float defaultValue)
        Equivalent to getFloat(key, defaultValue).
      • getFloat

        public float getFloat​(Enum<?> key)
        Equivalent to getFloat(key.name()). If key is null, 0.0F is returned.
      • getInt

        public abstract int getInt​(String key,
                                   int defaultValue)
        Get the value of the property identified by the key as int. If key is null or there is no property for the key, defaultValue is returned.
      • get

        public int get​(String key,
                       int defaultValue)
        Equivalent to getInt(key, defaultValue).
      • getInt

        public int getInt​(String key)
        Equivalent to getInt(key, 0).
      • getInt

        public int getInt​(Enum<?> key,
                          int defaultValue)
        Equivalent to getInt(key.name(), defaultValue). If key is null}, defaultValue is returned.
      • get

        public int get​(Enum<?> key,
                       int defaultValue)
        Equivalent to getInt(key, defaultValue).
      • getInt

        public int getInt​(Enum<?> key)
        Equivalent to getInt(key.name()). If key is null, 0 is returned.
      • getLong

        public abstract long getLong​(String key,
                                     long defaultValue)
        Get the value of the property identified by the key as long. If key is null or there is no property for the key, defaultValue is returned.
      • get

        public long get​(String key,
                        long defaultValue)
        Equivalent to getLong(key, defaultValue).
      • getLong

        public long getLong​(String key)
        Equivalent to getLong(key, 0L).
      • getLong

        public long getLong​(Enum<?> key,
                            long defaultValue)
        Equivalent to getLong(key.name(), defaultValue). If key is null, defaultValue is returned.
      • get

        public long get​(Enum<?> key,
                        long defaultValue)
        Equivalent to getLong(key, defaultValue).
      • getLong

        public long getLong​(Enum<?> key)
        Equivalent to getLong(key.name()). If key is null, 0L is returned.
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(String key,
                                                         Class<TEnum> enumClass,
                                                         TEnum defaultValue)
        Get the value of the property identified by the key as Enum. If key is null or there is no property for the key, defaultValue is returned.
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(String key,
                                                         TEnum defaultValue)
        Equivalent to getEnum(key, (Class<TEnum>)defaultValue.getClass(), defaultValue). defaultValue must not be null.
      • get

        public <TEnum extends Enum<TEnum>> TEnum get​(String key,
                                                     Class<TEnum> enumClass,
                                                     TEnum defaultValue)
        Equivalent to getEnum(key, enumClass, defaultValue).
      • get

        public <TEnum extends Enum<TEnum>> TEnum get​(String key,
                                                     TEnum defaultValue)
        Equivalent to getEnum(key, (Class<TEnum>)defaultValue.getClass(), defaultValue). defaultValue must not be null.
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(String key,
                                                         Class<TEnum> enumClass)
        Equivalent to getEnum(key, enumClass, null).
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(Enum<?> key,
                                                         Class<TEnum> enumClass,
                                                         TEnum defaultValue)
        Equivalent to getEnum(key.name(), enumClass, defaultValue). If key is null, defaultValue is returned.
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(Enum<?> key,
                                                         TEnum defaultValue)
        Equivalent to getEnum(key, (Class<TEnum>)defaultValue.getClass(), defaultValue). defaultValue must not be null.
      • get

        public <TEnum extends Enum<TEnum>> TEnum get​(Enum<?> key,
                                                     Class<TEnum> enumClass,
                                                     TEnum defaultValue)
        Equivalent to getEnum(key, enumClass, defaultValue).
      • get

        public <TEnum extends Enum<TEnum>> TEnum get​(Enum<?> key,
                                                     TEnum defaultValue)
        Equivalent to getEnum(key, (Class<TEnum>)defaultValue.getClass(), defaultValue). defaultValue must not be null.
      • getEnum

        public <TEnum extends Enum<TEnum>> TEnum getEnum​(Enum<?> key,
                                                         Class<TEnum> enumClass)
        Equivalent to getEnum(key.name(), enumClass). If key is null, null is returned.
      • getString

        public abstract String getString​(String key,
                                         String defaultValue)
        Get the value of the property identified by the key as String. If key is null or there is no property for the key, defaultValue is returned.
      • getString

        public String getString​(Enum<?> key,
                                String defaultValue)
        Equivalent to getString(key.name(), defaultValue). If key is null, defaultValue is returned.
      • getString

        public String getString​(Enum<?> key)
        Equivalent to getString(key.name()). If key is null, null is returned.
      • setBoolean

        public abstract void setBoolean​(String key,
                                        boolean value)
        Set the value to the property identified by the key. If key is null, nothing is done.
      • set

        public void set​(String key,
                        boolean value)
        Equivalent to setBoolean(key, value).
      • setBoolean

        public void setBoolean​(Enum<?> key,
                               boolean value)
        Equivalent to setBoolean(key.name(), value). If key is null, nothing is done.
      • set

        public void set​(Enum<?> key,
                        boolean value)
        Equivalent to setBoolean(key, value).
      • setFloat

        public abstract void setFloat​(String key,
                                      float value)
        Set the value to the property identified by the key. If key is null, nothing is done.
      • set

        public void set​(String key,
                        float value)
        Equivalent to setFloat(key, value).
      • setFloat

        public void setFloat​(Enum<?> key,
                             float value)
        Equivalent to setFloat(key.name(), value). If key is null, nothing is done.
      • set

        public void set​(Enum<?> key,
                        float value)
        Equivalent to setFloat(key, value).
      • setInt

        public abstract void setInt​(String key,
                                    int value)
        Set the value to the property identified by the key. If key is null, nothing is done.
      • set

        public void set​(String key,
                        int value)
        Equivalent to setInt(key, value).
      • setInt

        public void setInt​(Enum<?> key,
                           int value)
        Equivalent to setInt(key.name(), value). If key is null, nothing is done.
      • set

        public void set​(Enum<?> key,
                        int value)
        Equivalent to setInt(key, value).
      • setLong

        public abstract void setLong​(String key,
                                     long value)
        Set the value to the property identified by the key. If key is null, nothing is done.
      • set

        public void set​(String key,
                        long value)
        Equivalent to setLong(key, value).
      • setLong

        public void setLong​(Enum<?> key,
                            long value)
        Equivalent to setLong(key.name(), value). If key is null, nothing is done.
      • set

        public void set​(Enum<?> key,
                        long value)
        Equivalent to setLong(key, value).
      • setEnum

        public <TEnum extends Enum<TEnum>> void setEnum​(String key,
                                                        TEnum value)
        Equivalent to setString(key, (value == null) ? null : value.name()).
      • set

        public <TEnum extends Enum<TEnum>> void set​(String key,
                                                    TEnum value)
        Equivalent to setEnum(key, value).
      • setEnum

        public <TEnum extends Enum<TEnum>> void setEnum​(Enum<?> key,
                                                        TEnum value)
        Equivalent to setEnum(key.name(), value). If key is null, nothing is done.
      • set

        public <TEnum extends Enum<TEnum>> void set​(Enum<?> key,
                                                    TEnum value)
        Equivalent to setEnum(key, value).
      • setString

        public abstract void setString​(String key,
                                       String value)
        Set the value to the property identified by the key. If key is null, nothing is done.
      • setString

        public void setString​(Enum<?> key,
                              String value)
        Equivalent to setString(key.name(), value). If key is null, nothing is done.
      • remove

        public abstract void remove​(String key)
        Remove the property identified by the key. If key is null, nothing is done.
      • remove

        public void remove​(Enum<?> key)
        Equivalent to remove(key.name()). If key is null, nothing is done.
      • clear

        public abstract void clear()
        Clear all properties.