package org.noreply.fancydress.directory.parser;
/**
* Hold one key/value pair in a directory.
*
* This class holds one key/value pair in a directory. The
* values themselves are still Strings, not parsed into
* dates or octet strings.
*
* A DirectoySection
is made up of entries like this.
*
* @see org.noreply.fancydress.directory.Directory
* @see DirectoryParser
* @see DirectoryMessage
* @see DirectorySection
*/
public class DirectoryEntry {
private String name;
private String value;
/**
* Default constructor.
*
* Creates a new DirectoryEntry.
*
* @param name name of the entry.
* @param value value of the entry.
*/
public DirectoryEntry(String name, String value) {
this.name = name;
this.value = value;
}
/**
* Copy constructor.
*
* Creates a new DirectoryEntry copying the data from entry
*
* @param entry entry to copy
*/
public DirectoryEntry(DirectoryEntry entry) {
this.name = new String(entry.name);
this.value = new String(entry.value);
}
/**
* Blint this value in order to verify or create a signature.
*/
public void blindValue() {
value = "";
};
/**
* Returns a string representation of the directory.
*
* @return a string representation of the object.
*/
public String toString() {
if (value.equals(""))
return new String(name+":");
else
return new String(name+": "+value);
}
/**
* Returns the name of this section.
*
* @return name of this section.
*/
public String getName() {
return name;
}
/**
* Returns the value of this section.
*
* @return value of this section.
*/
public String getValue() {
return value;
}
}