Cumulus4j API
(1.1.0)

org.cumulus4j.keystore.prop
Class LongProperty

java.lang.Object
  extended by org.cumulus4j.keystore.prop.Property<Long>
      extended by org.cumulus4j.keystore.prop.LongProperty
All Implemented Interfaces:
Comparable<Property<?>>

public class LongProperty
extends Property<Long>

Property implementation for the value type Long.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
LongProperty()
           
 
Method Summary
 byte[] getValueEncoded()
           Get the property's value encoded as byte-array or null, if the property is empty.
 void setValueEncoded(byte[] encodedValue)
           Set the property's value encoded as byte-array or null, if the property shall be empty.
 
Methods inherited from class org.cumulus4j.keystore.prop.Property
compareTo, equals, getName, getValue, getXxx, hashCode, setName, setValue, setXxx, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongProperty

public LongProperty()
Method Detail

getValueEncoded

public 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 Property.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 Property.setValueEncoded(byte[]).

The implementation in LongProperty returns either null or 8 bytes containing the long value in a pretty raw form (copied byte-by-byte).

Specified by:
getValueEncoded in class Property<Long>
Returns:
the byte-array-representation of the property-value or null.
See Also:
Property.setValueEncoded(byte[])

setValueEncoded

public 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 Property.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.

Specified by:
setValueEncoded in class Property<Long>
Parameters:
encodedValue - the byte-array-representation of the property-value or null.
Throws:
IllegalArgumentException - if the encodedValue is neither null nor a byte-array with a length of exactly 8.
See Also:
Property.getValueEncoded()

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.