ca.beq.util.win32.registry
Class RegistryValue

java.lang.Object
  |
  +--ca.beq.util.win32.registry.RegistryValue

public class RegistryValue
extends Object

A representation of registry values. A registry value is defined as a collection of the following properties: name, type, and data.

A name consists of a string of one or more printable characters, excluding the backslash (\). A type may be any of the defined ValueType's. Data is any object, consistent with the ValueType.

Version:
1.0
Author:
BEQ Technologies Inc.

Constructor Summary
RegistryValue()
          Constructs a new, empty, RegistryValue.
RegistryValue(Object data)
          Constructs a new RegistryValue with the specified data.
RegistryValue(String name, boolean data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, byte data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, double data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, float data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, int data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, long data)
          Constructs a new RegistryValue with the specified name, and data.
RegistryValue(String name, Object data)
          Constructs a new RegistryValue with the specified name and data.
RegistryValue(String name, ValueType type, Object data)
          Constructs a new RegistryValue with the specified name, type, and data.
 
Method Summary
 Object getData()
          Returns this RegistryValue's data.
 String getName()
          Returns this RegistryValue's name.
 ValueType getType()
          Returns this RegistryValue's ValueType.
 void setData(boolean data)
          Sets this RegistryValue's data.
 void setData(byte data)
          Sets this RegistryValue's data.
 void setData(double data)
          Sets this RegistryValue's data.
 void setData(float data)
          Sets this RegistryValue's data.
 void setData(int data)
          Sets this RegistryValue's data.
 void setData(long data)
          Sets this RegistryValue's data.
 void setData(Object data)
          Sets this RegistryValue's data.
 void setName(String name)
          Sets this RegistryValue's name.
 void setType(ValueType type)
          Sets this RegistryValue's ValueType.
 String toString()
          Returns a string representation of this RegistryValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegistryValue

public RegistryValue()
Constructs a new, empty, RegistryValue.

RegistryValue

public RegistryValue(Object data)
Constructs a new RegistryValue with the specified data. The type is defaulted to ValueType.REG_SZ. The name defaults to ""; the default value name.
Parameters:
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     Object data)
Constructs a new RegistryValue with the specified name and data. The type is defaulted to ValueType.REG_SZ.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     ValueType type,
                     Object data)
Constructs a new RegistryValue with the specified name, type, and data.
Parameters:
name - the RegistryValue's name
type - the RegistryValue's type
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     boolean data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_DWORD.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     byte data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_BINARY.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     int data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_DWORD.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     long data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_DWORD.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     float data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_BINARY.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data

RegistryValue

public RegistryValue(String name,
                     double data)
Constructs a new RegistryValue with the specified name, and data. The type is ValueType.REG_BINARY.
Parameters:
name - the RegistryValue's name
data - the RegistryValue's data
Method Detail

getName

public String getName()
Returns this RegistryValue's name.
Returns:
the RegistryValue's name

setName

public void setName(String name)
Sets this RegistryValue's name.
Parameters:
name - the RegistryValue's name

getType

public ValueType getType()
Returns this RegistryValue's ValueType.
Returns:
the RegistryValue's type

setType

public void setType(ValueType type)
Sets this RegistryValue's ValueType.
Parameters:
name - the RegistryValue's type

getData

public Object getData()
Returns this RegistryValue's data.
Returns:
the RegistryValue's data

setData

public void setData(Object data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(byte data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(boolean data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(int data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(long data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(float data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

setData

public void setData(double data)
Sets this RegistryValue's data.
Parameters:
name - the RegistryValue's data

toString

public String toString()
Returns a string representation of this RegistryValue.
Overrides:
toString in class Object
Returns:
the RegistryValue as a String
Throws:
NullPointerException - if the name or data properties are null.