Class StringValue
- java.lang.Object
-
- com.github.robtimus.os.windows.registry.RegistryValue
-
- com.github.robtimus.os.windows.registry.SettableRegistryValue
-
- com.github.robtimus.os.windows.registry.StringValue
-
public final class StringValue extends SettableRegistryValue
A representation of string 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 booleanequals(Object o)static StringValueexpandableOf(String name, String value)Creates a new string registry value.StringexpandedValue()Returns the registry value's expanded string value.inthashCode()booleanisExpandable()Returns whether or not this registry value is an expandable string registry value.static StringValueof(String name, String value)Creates a new string registry value.StringtoString()Stringvalue()Returns the registry value's string value.StringValuewithExpandableValue(String value)Returns a registry value with the same name as this registry value but a different value.StringValuewithName(String name)Returns a registry value with the same value as this registry value but a different name.StringValuewithValue(String 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 StringValue of(String name, String value)
Creates a new string registry value.- Parameters:
name- The name of the registry value.value- The registry value's string value.- Returns:
- The created string registry value.
- Throws:
NullPointerException- If the given name or value isnull.
-
expandableOf
public static StringValue expandableOf(String name, String value)
Creates a new string registry value.- Parameters:
name- The name of the registry value.value- The registry value's string value.- Returns:
- The created string registry value.
- Throws:
NullPointerException- If the given name or value isnull.
-
value
public String value()
Returns the registry value's string value. For expandable string registry values, this is the unexpanded value. UseexpandedValue()for the expanded value.- Returns:
- The registry value's string value.
-
isExpandable
public boolean isExpandable()
Returns whether or not this registry value is an expandable string registry value. If so, its value can be expanded.- Returns:
trueif this registry value is an expandable string registry value, orfalseotherwise.- See Also:
expandedValue()
-
expandedValue
public String expandedValue()
Returns the registry value's expanded string value.- Returns:
- The registry value's expanded string value.
- Throws:
IllegalStateException- If this registry value is notexpandable.
-
withName
public StringValue withName(String name)
Description copied from class:SettableRegistryValueReturns a registry value with the same value as this registry value but a different name.- Specified by:
withNamein 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 StringValue withValue(String value)
Returns a registry value with the same name as this registry value but a different value. This registry value will not beexpandable.- 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.
- Throws:
NullPointerException- If the given value isnull.
-
withExpandableValue
public StringValue withExpandableValue(String value)
Returns a registry value with the same name as this registry value but a different value. This registry value will beexpandable.- 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.
- Throws:
NullPointerException- If the given value isnull.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classRegistryValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classRegistryValue
-
-