|
Cumulus4j API (1.2.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cumulus4j.keystore.prop.Property<T>
T
- the type of the property-value.public abstract class Property<T>
Base class for all properties.
The KeyStore
supports managing arbitrary properties in the form of
name-value-pairs. The names are plain-text, but the values are encrypted.
A property-value can be of any type for which a subclass of
Property
exists.
Important: Do not instantiate properties yourself! Use KeyStore.getProperty(String, char[], Class, String)
instead!
Constructor Summary | |
---|---|
Property()
|
Method Summary | |
---|---|
int |
compareTo(Property<?> o)
|
boolean |
equals(Object obj)
|
String |
getName()
Get the property's unique name. |
T |
getValue()
Get the property's value. |
abstract byte[] |
getValueEncoded()
Get the property's value encoded as byte-array or null , if the
property is empty. |
UUID |
getXxx()
Internal value used to detect improper usage of the API. |
int |
hashCode()
|
void |
setName(String name)
Set the property's unique name. |
void |
setValue(T value)
Set the property's value. |
abstract void |
setValueEncoded(byte[] encodedValue)
Set the property's value encoded as byte-array or null ,
if the property shall be empty. |
void |
setXxx(UUID xxx)
Internal value used to detect improper usage of the API. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Property()
Method Detail |
---|
public String getName()
Get the property's unique name.
This name is used as key to uniquely identify a property in the key store.
public void setName(String name)
Set the property's unique name.
You should never call this method directly. The name is set by KeyStore.getProperty(String, char[], Class, String)
.
name
- the property's name.public T getValue()
null
.setValue(Object)
public void setValue(T value)
value
- the value or null
.getValue()
public abstract byte[] getValueEncoded()
Get the property's value
encoded as byte-array or null
, if the
property is empty. Note, that this might be null
, even though getValue()
returns
a non-null
value; for example an empty Collection
might cause this.
This method must encode the value in a way that can be decoded by setValueEncoded(byte[])
.
null
.setValueEncoded(byte[])
public abstract void setValueEncoded(byte[] encodedValue) throws IllegalArgumentException
Set the property's value
encoded as byte-array or null
,
if the property shall be empty.
This method must be symmetric to getValueEncoded()
, i.e. every possible result of getValueEncoded()
must be understood by this method. A byte-array that is not understood should cause an IllegalArgumentException
.
encodedValue
- the byte-array-representation of the property-value or null
.
IllegalArgumentException
- if the encodedValue
cannot be parsed.getValueEncoded()
public String toString()
toString
in class Object
public UUID getXxx()
Internal value used to detect improper usage of the API.
Important: This method is not part of the API! Do not use this method!
KeyStore.getProperty(String, char[], Class, String)
public void setXxx(UUID xxx)
Internal value used to detect improper usage of the API.
Important: This method is not part of the API! Do not use this method!
xxx
- the internal value.KeyStore.getProperty(String, char[], Class, String)
public int compareTo(Property<?> o)
compareTo
in interface Comparable<Property<?>>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
Cumulus4j API (1.2.0) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |