/** * Remove the property under the given key as a double, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public double removeDoubleProperty(String key, double def) { if (!containsKey(key)) return def; return removeDoubleProperty(key); }
/** * Return the property under the given key as a boolean, or false if * it does not exist and has no set default. */ public boolean getBooleanProperty(String key) { return getBooleanProperty(key, false); }
/** * Return the property under the given key as a double, or 0 if * it does not exist and has no set default. * * @throws NumberFormatException on parse error */ public double getDoubleProperty(String key) { return getDoubleProperty(key, 0D); }
/** * Remove the given property, or return the given default if it does * not exist. */ public String removeProperty(String key, String def) { if (!containsKey(key)) return def; return removeProperty(key); }
/** * Remove the property under the given key as a float, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public float removeFloatProperty(String key, float def) { if (!containsKey(key)) return def; return removeFloatProperty(key); }
/** * Return the property under the given key as a float, or the given * default if it does not exist. * * @throws NumberFormatException on parse error */ public float getFloatProperty(String key, float def) { String val = getProperty(key); return (val == null) ? def : Float.parseFloat(val); }
/** * Remove the property under the given key as a boolean, or return the * given default if it does not exist. */ public boolean removeBooleanProperty(String key, boolean def) { if (!containsKey(key)) return def; return removeBooleanProperty(key); }
/** * Remove the property under the given key as a int, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public int removeIntProperty(String key, int def) { if (!containsKey(key)) return def; return removeIntProperty(key); }
/** * Remove the property under the given key as a long, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public long removeLongProperty(String key, long def) { if (!containsKey(key)) return def; return removeLongProperty(key); } }
/** * Overrides {@link Properties#setProperty(String,String)} to remove * the key if the given value is <code>null</code>. * * @see Properties#setProperty(String,String) */ public Object setProperty(String key, String val) { if (val == null) return remove(key); return super.setProperty(key, val); }
/** * Return the property under the given key as an int, or 0 if * it does not exist and has no set default. * * @throws NumberFormatException on parse error */ public int getIntProperty(String key) { return getIntProperty(key, 0); }
/** * Return the property under the given key as a long, or 0 if * it does not exist and has no set default. * * @throws NumberFormatException on parse error */ public long getLongProperty(String key) { return getLongProperty(key, 0L); }
/** * Return the property under the given key as a float, or 0 if * it does not exist and has no set default. * * @throws NumberFormatException on parse error */ public float getFloatProperty(String key) { return getFloatProperty(key, 0F); }
/** * Return the property under the given key as an int, or the given * default if it does not exist. * * @throws NumberFormatException on parse error */ public int getIntProperty(String key, int def) { String val = getProperty(key); return (val == null) ? def : Integer.parseInt(val); }
/** * Remove the given property, or return the given default if it does * not exist. */ public String removeProperty(String key, String def) { if (!containsKey(key)) return def; return removeProperty(key); }
/** * Remove the property under the given key as a float, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public float removeFloatProperty(String key, float def) { if (!containsKey(key)) return def; return removeFloatProperty(key); }
/** * Remove the property under the given key as a boolean, or return the * given default if it does not exist. */ public boolean removeBooleanProperty(String key, boolean def) { if (!containsKey(key)) return def; return removeBooleanProperty(key); }
/** * Remove the property under the given key as a int, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public int removeIntProperty(String key, int def) { if (!containsKey(key)) return def; return removeIntProperty(key); }
/** * Remove the property under the given key as a long, or return the * given default if it does not exist. * * @throws NumberFormatException on parse error */ public long removeLongProperty(String key, long def) { if (!containsKey(key)) return def; return removeLongProperty(key); } }
/** * Overrides {@link Properties#setProperty(String,String)} to remove * the key if the given value is <code>null</code>. * * @see Properties#setProperty(String,String) */ public Object setProperty(String key, String val) { if (val == null) return remove(key); return super.setProperty(key, val); }