Class DWordValue
- java.lang.Object
-
- com.github.robtimus.os.windows.registry.RegistryValue
-
- com.github.robtimus.os.windows.registry.SettableRegistryValue
-
- com.github.robtimus.os.windows.registry.DWordValue
-
public final class DWordValue extends SettableRegistryValue
A representation of DWORD registry values. Instances of this class are immutable.- Author:
- Rob Spoor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.robtimus.os.windows.registry.RegistryValue
RegistryValue.Filter
-
-
Field Summary
-
Fields inherited from class com.github.robtimus.os.windows.registry.RegistryValue
DEFAULT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DWordValue
bigEndianOf(String name, int value)
Creates a new big-endian DWORD registry value.boolean
equals(Object o)
int
hashCode()
static DWordValue
littleEndianOf(String name, int value)
Creates a new little-endian DWORD registry value.static DWordValue
of(String name, int value)
Creates a new DWORD registry value.String
toString()
int
value()
Returns the registry value's DWORD value.DWordValue
withBigEndianValue()
Returns a registry value with the same name and value as this registry value but big-endian byte order.DWordValue
withBigEndianValue(int value)
Returns a registry value with the same name as this registry value but a different big-endian value.DWordValue
withLittleEndianValue()
Returns a registry value with the same name and value as this registry value but little-endian byte order.DWordValue
withLittleEndianValue(int value)
Returns a registry value with the same name as this registry value but a different little-endian value.DWordValue
withName(String name)
Returns a registry value with the same value as this registry value but a different name.DWordValue
withValue(int value)
Returns a registry value with the same name as this registry value but a different value.-
Methods inherited from class com.github.robtimus.os.windows.registry.RegistryValue
filter, name
-
-
-
-
Method Detail
-
of
public static DWordValue of(String name, int value)
Creates a new DWORD registry value.- Parameters:
name
- The name of the registry value.value
- The registry value's DWORD value.- Returns:
- The created DWORD registry value.
- Throws:
NullPointerException
- If the given name isnull
.
-
littleEndianOf
public static DWordValue littleEndianOf(String name, int value)
Creates a new little-endian DWORD registry value. This is actually the same asof(String, int)
, but makes the byte order explicit.- Parameters:
name
- The name of the registry value.value
- The registry value's DWORD value.- Returns:
- The created DWORD registry value.
- Throws:
NullPointerException
- If the given name isnull
.
-
bigEndianOf
public static DWordValue bigEndianOf(String name, int value)
Creates a new big-endian DWORD registry value.- Parameters:
name
- The name of the registry value.value
- The registry value's DWORD value.- Returns:
- The created DWORD registry value.
- Throws:
NullPointerException
- If the given name isnull
.
-
value
public int value()
Returns the registry value's DWORD value.- Returns:
- The registry value's DWORD value.
-
withName
public DWordValue withName(String name)
Description copied from class:SettableRegistryValue
Returns a registry value with the same value as this registry value but a different name.- Specified by:
withName
in classSettableRegistryValue
- Parameters:
name
- The name of the registry value to return.- Returns:
- A registry value with the same value as this registry value and the given name.
-
withValue
public DWordValue withValue(int value)
Returns a registry value with the same name as this registry value but a different value. This method does not change the byte order.- Parameters:
value
- The value of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given value.
-
withLittleEndianValue
public DWordValue withLittleEndianValue(int value)
Returns a registry value with the same name as this registry value but a different little-endian value.- Parameters:
value
- The value of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given value.
-
withBigEndianValue
public DWordValue withBigEndianValue(int value)
Returns a registry value with the same name as this registry value but a different big-endian value.- Parameters:
value
- The value of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given value.
-
withLittleEndianValue
public DWordValue withLittleEndianValue()
Returns a registry value with the same name and value as this registry value but little-endian byte order.- Returns:
- A registry value with the same name and value as this registry value but little-endian byte order.
-
withBigEndianValue
public DWordValue withBigEndianValue()
Returns a registry value with the same name and value as this registry value but big-endian byte order.- Returns:
- A registry value with the same name and value as this registry value but big-endian byte order.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classRegistryValue
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classRegistryValue
-
-