org.jSyncManager.API.Protocol.Util

Class DLPAppPreference


public class DLPAppPreference
extends java.lang.Object

A class to hold a handheld application preference. This class stores application preference data.

Field Summary

static char
READ_ACTUAL_SIZE
Used when specifying the number of bytes to return when requesting an app preference, this value will return all the bytes in the application preference.
static byte
REQUEST_BACKUP_PREF
A flag to request a backup preference.

Constructor Summary

DLPAppPreference()
Create a new, empty application preference object.
DLPAppPreference(byte[] data)
Create an application preference object from the provided byte representation.

Method Summary

char
getActualSize()
Return the actual reported size of the app preference.
byte[]
getPreference()
Get the application preference as a byte array.
char
getVersion()
Get the version of the app preference.
void
setActualSize(char newValue)
Set the actual size of the app preference.
void
setPreference(byte[] newValue)
Set the preference data.
void
setVersion(char newValue)
Set the version for this application preference.
String
toString()
Convert the application preference to human-readable text.

Field Details

READ_ACTUAL_SIZE

public static final char READ_ACTUAL_SIZE
Used when specifying the number of bytes to return when requesting an app preference, this value will return all the bytes in the application preference.
Field Value:
'\uffff'

REQUEST_BACKUP_PREF

public static final byte REQUEST_BACKUP_PREF
A flag to request a backup preference.
Field Value:
-128

Constructor Details

DLPAppPreference

public DLPAppPreference()
Create a new, empty application preference object.

DLPAppPreference

public DLPAppPreference(byte[] data)
            throws DLPFunctionCallException
Create an application preference object from the provided byte representation.
Parameters:
data - the byte representation of an app preference, as read from the handheld.
Throws:
DLPFunctionCallException - thrown in the event of any errors with the preference data.

Method Details

getActualSize

public char getActualSize()
Return the actual reported size of the app preference. In order to satisfy packet byte alignment issues, the handheld may return more bytes than are actually in the preference. This value may thus be slightly smaller than the number of bytes in the preference data.
Returns:
the actual reported size of the app preference.

getPreference

public byte[] getPreference()
Get the application preference as a byte array.
Returns:
the application preference as a byte array.

getVersion

public char getVersion()
Get the version of the app preference.
Returns:
the version of the app preference.

setActualSize

public void setActualSize(char newValue)
Set the actual size of the app preference.
Parameters:
newValue - the actual size of the app preference.

setPreference

public void setPreference(byte[] newValue)
Set the preference data.
Parameters:
newValue - the new preference data.

setVersion

public void setVersion(char newValue)
Set the version for this application preference.
Parameters:
newValue - the version for this application preference.

toString

public String toString()
Convert the application preference to human-readable text.
Returns:
this app preference as a String of human-readable text.