public class RegDataContainer extends Object implements Cloneable, Serializable
Data container for Windows registry values. Windows registry values can contain different data types. It is not possible to map they all to one Java type. Therefore this class contains the different container types.
Modifier and Type | Field and Description |
---|---|
private byte[] |
binData |
private long |
dwordData |
private String[] |
multiStringData |
static int |
REG_BINARY |
static int |
REG_DWORD |
static int |
REG_EXPAND_SZ |
static int |
REG_LINK |
static int |
REG_MULTI_SZ |
static int |
REG_NONE |
static int |
REG_SZ |
private static long |
serialVersionUID |
private String |
stringData |
private int |
type |
private static int[] |
VALID_TYPES |
Constructor and Description |
---|
RegDataContainer()
Default constructor.
|
RegDataContainer(byte[] data)
Creates a RegDataContainer for type REG_BINARY with the given data
|
RegDataContainer(int type)
Creates a RegDataContainer for a special type The data self is not set.
|
RegDataContainer(long data)
Creates a RegDataContainer for type REG_DWORD with the given data
|
RegDataContainer(String data)
Creates a RegDataContainer for type REG_SZ with the given data
|
RegDataContainer(String[] data)
Creates a RegDataContainer for type REG_MULTI_SZ with the given data
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
equals(Object anObject) |
byte[] |
getBinData()
Returns the binary data of this container.
|
Object |
getDataAsObject()
Returns the contained data depending to the type.
|
long |
getDwordData()
Returns the dword data of this container.
|
String[] |
getMultiStringData()
Returns the multi string data as string array of this container.
|
String |
getStringData()
Returns the string data of this container.
|
int |
getType()
Returns the data type handled by this object.
|
boolean |
isValidType(int type)
Verifies whether the given int represents a valid type or not.
|
void |
setBinData(byte[] bytes)
Sets the binary data to the given byte array.
|
void |
setDwordData(long i)
Sets the dword data to the given value.
|
void |
setMultiStringData(String[] strings)
Sets the multi string data to the given string array.
|
void |
setStringData(String string)
Sets the string data to the given value.
|
void |
setType(int i)
Sets the type.
|
private static final long serialVersionUID
public static final int REG_NONE
public static final int REG_SZ
public static final int REG_EXPAND_SZ
public static final int REG_BINARY
public static final int REG_DWORD
public static final int REG_LINK
public static final int REG_MULTI_SZ
private static final int[] VALID_TYPES
private long dwordData
private String stringData
private String[] multiStringData
private byte[] binData
private int type
public RegDataContainer()
public RegDataContainer(int type) throws IllegalArgumentException
type
- IllegalArgumentException
- if the type is not validpublic RegDataContainer(long data)
data
- data which should be used with this objectpublic RegDataContainer(String data)
data
- data which should be used with this objectpublic RegDataContainer(String[] data)
data
- data which should be used with this objectpublic RegDataContainer(byte[] data)
data
- data which should be used with this objectpublic byte[] getBinData()
public long getDwordData()
public String[] getMultiStringData()
public String getStringData()
public int getType()
public void setBinData(byte[] bytes)
bytes
- data to be setpublic void setDwordData(long i)
i
- data to be setpublic void setMultiStringData(String[] strings)
strings
- data to be setpublic void setStringData(String string)
string
- data to be setpublic void setType(int i)
i
- type to be setpublic boolean isValidType(int type)
type
- value to be verifiedpublic Object getDataAsObject()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses