Class MultiStringValue
- java.lang.Object
-
- com.github.robtimus.os.windows.registry.RegistryValue
-
- com.github.robtimus.os.windows.registry.SettableRegistryValue
-
- com.github.robtimus.os.windows.registry.MultiStringValue
-
public final class MultiStringValue extends SettableRegistryValue
A representation of multi-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 boolean
equals(Object o)
int
hashCode()
static MultiStringValue
of(String name, String... values)
Creates a new multi-string registry value.static MultiStringValue
of(String name, List<String> values)
Creates a new multi-string registry value.String
toString()
List<String>
values()
Returns the registry value's string values.MultiStringValue
withName(String name)
Returns a registry value with the same value as this registry value but a different name.MultiStringValue
withValues(String... values)
Returns a registry value with the same name as this registry value but a different value.MultiStringValue
withValues(List<String> values)
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 MultiStringValue of(String name, String... values)
Creates a new multi-string registry value.- Parameters:
name
- The name of the registry value.values
- The registry value's string values.- Returns:
- The created multi-string registry value.
- Throws:
NullPointerException
- If the name or any of the given values isnull
.IllegalArgumentException
- If any of the given values is empty.
-
of
public static MultiStringValue of(String name, List<String> values)
Creates a new multi-string registry value.- Parameters:
name
- The name of the registry value.values
- The registry value's string values.- Returns:
- The created multi-string registry value.
- Throws:
NullPointerException
- If the name or any of the given values isnull
.IllegalArgumentException
- If any of the given values is empty.
-
values
public List<String> values()
Returns the registry value's string values.- Returns:
- An unmodifiable list with the registry value's string values.
-
withName
public MultiStringValue 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.
-
withValues
public MultiStringValue withValues(String... values)
Returns a registry value with the same name as this registry value but a different value.- Parameters:
values
- The values of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given values.
- Throws:
NullPointerException
- If any of the given values isnull
.IllegalArgumentException
- If any of the given values is empty.
-
withValues
public MultiStringValue withValues(List<String> values)
Returns a registry value with the same name as this registry value but a different value.- Parameters:
values
- The values of the registry value to return.- Returns:
- A registry value with the same name as this registry value and the given values.
- Throws:
NullPointerException
- If any of the given values isnull
.IllegalArgumentException
- If any of the given values is empty.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classRegistryValue
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classRegistryValue
-
-