|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnu.studer.java.util.OrderedProperties
public final class OrderedProperties
This class provides an alternative to the JDK's Properties class. It fixes the design flaw of using
inheritance over composition, while keeping up the same APIs as the original class. Keys and values are
guaranteed to be of type String.
Properties class from the JDK.
Properties,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
OrderedProperties.OrderedPropertiesBuilder
Builder for OrderedProperties instances. |
| Constructor Summary | |
|---|---|
OrderedProperties()
Creates a new instance that will keep the properties in the order they have been added. |
|
| Method Summary | |
|---|---|
boolean |
containsProperty(java.lang.String key)
Returns true if there is a property with the specified key. |
static OrderedProperties |
copyOf(OrderedProperties source)
Creates a new instance that will have both the same property entries and the same behavior as the given source. |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entrySet()
See Hashtable.entrySet(). |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getProperty(java.lang.String key)
See Properties.getProperty(String). |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
See Properties.getProperty(String, String). |
int |
hashCode()
|
boolean |
isEmpty()
See Hashtable.isEmpty(). |
void |
load(java.io.InputStream stream)
See Properties.load(InputStream). |
void |
load(java.io.Reader reader)
See Properties.load(Reader). |
void |
loadFromXML(java.io.InputStream stream)
See Properties.loadFromXML(InputStream). |
java.util.Enumeration<java.lang.String> |
propertyNames()
See Properties.propertyNames(). |
java.lang.String |
removeProperty(java.lang.String key)
Removes the property with the specified key, if it is present. |
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
See Properties.setProperty(String, String). |
int |
size()
See Hashtable.size(). |
void |
store(java.io.OutputStream stream,
java.lang.String comments)
See Properties.store(OutputStream, String). |
void |
store(java.io.Writer writer,
java.lang.String comments)
See Properties.store(Writer, String). |
void |
storeToXML(java.io.OutputStream stream,
java.lang.String comment)
See Properties.storeToXML(OutputStream, String). |
void |
storeToXML(java.io.OutputStream stream,
java.lang.String comment,
java.lang.String encoding)
See Properties.storeToXML(OutputStream, String, String). |
java.util.Set<java.lang.String> |
stringPropertyNames()
See Properties.stringPropertyNames(). |
java.util.Properties |
toJdkProperties()
Convert this instance to a Properties instance. |
java.lang.String |
toString()
See Hashtable.toString(). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OrderedProperties()
Properties class.
| Method Detail |
|---|
public java.lang.String getProperty(java.lang.String key)
Properties.getProperty(String).
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
Properties.getProperty(String, String).
public java.lang.String setProperty(java.lang.String key,
java.lang.String value)
Properties.setProperty(String, String).
public java.lang.String removeProperty(java.lang.String key)
key - the key of the property to remove
public boolean containsProperty(java.lang.String key)
key - the key whose presence is to be testedpublic int size()
Hashtable.size().
public boolean isEmpty()
Hashtable.isEmpty().
public java.util.Enumeration<java.lang.String> propertyNames()
Properties.propertyNames().
public java.util.Set<java.lang.String> stringPropertyNames()
Properties.stringPropertyNames().
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> entrySet()
Hashtable.entrySet().
public void load(java.io.InputStream stream)
throws java.io.IOException
Properties.load(InputStream).
java.io.IOException
public void load(java.io.Reader reader)
throws java.io.IOException
Properties.load(Reader).
java.io.IOException
public void loadFromXML(java.io.InputStream stream)
throws java.io.IOException,
java.util.InvalidPropertiesFormatException
Properties.loadFromXML(InputStream).
java.io.IOException
java.util.InvalidPropertiesFormatException
public void store(java.io.OutputStream stream,
java.lang.String comments)
throws java.io.IOException
Properties.store(OutputStream, String).
java.io.IOException
public void store(java.io.Writer writer,
java.lang.String comments)
throws java.io.IOException
Properties.store(Writer, String).
java.io.IOException
public void storeToXML(java.io.OutputStream stream,
java.lang.String comment)
throws java.io.IOException
Properties.storeToXML(OutputStream, String).
java.io.IOException
public void storeToXML(java.io.OutputStream stream,
java.lang.String comment,
java.lang.String encoding)
throws java.io.IOException
Properties.storeToXML(OutputStream, String, String).
java.io.IOExceptionpublic java.util.Properties toJdkProperties()
Properties instance.
Properties instancepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
Hashtable.toString().
toString in class java.lang.Objectpublic static OrderedProperties copyOf(OrderedProperties source)
source - the source to copy from
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||