gnu.crypto.keyring

Class Properties

public class Properties extends Object implements Cloneable

A set of (name => value) pairs used in keyring entries. Keys and values are simple strings, with the key never being empty and always treated case-insensitively.
Constructor Summary
Properties()
Creates a new properties object.
Method Summary
voidclear()
Removes all properties from this object.
Objectclone()
Creates a copy of this properties object.
booleancontainsKey(String key)
Tests if this object contains a given property name.
booleancontainsValue(String value)
Tests if this object contains a given property value.
voiddecode(DataInputStream in)
Decodes a set of properties from the given input stream.
voidencode(DataOutputStream out)
Encodes this set of properties to the given output stream.
Stringget(String key)
Returns the value mapped by the given key, or null if there is no such mapping.
Stringput(String key, String value)
Adds a new property to this object.
Stringremove(String key)
Removes a key and its value from this object.
StringtoString()

Constructor Detail

Properties

public Properties()
Creates a new properties object.

Method Detail

clear

public void clear()
Removes all properties from this object.

clone

public Object clone()
Creates a copy of this properties object.

Returns: The copy.

containsKey

public boolean containsKey(String key)
Tests if this object contains a given property name.

Parameters: key The key to test.

Returns: True if this object contains the given key.

containsValue

public boolean containsValue(String value)
Tests if this object contains a given property value.

Parameters: value The value to test.

Returns: True if this object contains the given value.

decode

public void decode(DataInputStream in)
Decodes a set of properties from the given input stream.

Parameters: in The input stream.

Throws: IOException If an I/O error occurs.

encode

public void encode(DataOutputStream out)
Encodes this set of properties to the given output stream.

Parameters: out The output stream to encode to.

Throws: IOException If an I/O error occurs.

get

public String get(String key)
Returns the value mapped by the given key, or null if there is no such mapping.

Parameters: key

put

public String put(String key, String value)
Adds a new property to this object.

Parameters: key The key, which can neither be null nor empty. value The value, which cannot be null.

Returns: The old value mapped by the key, if any.

Throws: IllegalArgumentException If either the key or value parameter is null, or if the key is empty.

remove

public String remove(String key)
Removes a key and its value from this object.

Parameters: key The key of the property to remove.

Returns: The old value mapped by the key, if any.

toString

public String toString()
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.