/** * Reads the named property from this properties storage, returning the default value if there * is no such property. * @param key a case-sensitive identifier for a property, or null * @param defaultValue a value to return in case the specified key was null * @return the value associated with the key, or the specified default value if either no such * property is set, or the specified key was null * @throws IndexException */ public String getProperty(String key, String defaultValue) throws IndexException { String val= getProperty(key); return (val == null) ? defaultValue : val; }
/** * Deletes all properties stored in this object and the record associated with this object * itself. * <br><br> * <b>The behaviour of objects of this class after calling this method is undefined</b> * @throws IndexException */ public void delete() throws IndexException { clear(); this.db.free(this.record, Database.POOL_DB_PROPERTIES); }
/** * Writes the key, value mapping to the properties. If a mapping for the * same key already exists, it is overwritten. * @param key a non-null property name * @param value a value to associate with the key. may not be null. * @throws IndexException * @throws NullPointerException if key is null */ public void setProperty(String key, String value) throws IndexException { removeProperty(key); DBProperty newProperty= new DBProperty(this.db, key, value); this.index.insert(newProperty.getRecord()); }
/** * Deletes all properties stored in this object and the record associated with this object * itself. * <br><br> * <b>The behaviour of objects of this class after calling this method is undefined</b> * @throws IndexException */ public void delete() throws IndexException { clear(); this.db.free(this.record, Database.POOL_DB_PROPERTIES); }
/** * Writes the key, value mapping to the properties. If a mapping for the * same key already exists, it is overwritten. * @param key a non-null property name * @param value a value to associate with the key. may not be null. * @throws IndexException * @throws NullPointerException if key is null */ public void setProperty(String key, String value) throws IndexException { removeProperty(key); DBProperty newProperty= new DBProperty(this.db, key, value); this.index.insert(newProperty.getRecord()); }
/** * Reads the named property from this properties storage, returning the default value if there * is no such property. * @param key a case-sensitive identifier for a property, or null * @param defaultValue a value to return in case the specified key was null * @return the value associated with the key, or the specified default value if either no such * property is set, or the specified key was null * @throws IndexException */ public String getProperty(String key, String defaultValue) throws IndexException { String val= getProperty(key); return (val == null) ? defaultValue : val; }