Package net.solarnetwork.node.settings
Class SettingsCommand
java.lang.Object
net.solarnetwork.node.settings.SettingsCommand
- All Implemented Interfaces:
SettingsUpdates
Edit settings command object.
- Version:
- 1.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.node.settings.SettingsUpdates
SettingsUpdates.Change -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SettingsCommand(boolean force) Construct with a "forced" setting.SettingsCommand(List<SettingValueBean> values) Constructor.SettingsCommand(List<SettingValueBean> values, Iterable<Pattern> settingKeyPatternsToClean) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the instance key.Get the provider key.Get a collection of setting key patterns to clean before apply any setting value updates.Iterable<? extends SettingsUpdates.Change>Get a collection of setting values to apply.Get the values.booleanTest if there are any setting patterns to clean.booleanTest if there are any updates to apply.booleanisForce()Get the flag indicating if the update command should be forced, even if there are no setting values.voidsetForce(boolean force) Set a flag indicating if the update command should be forced, even if there are no setting values.voidsetInstanceKey(String instanceKey) Set the instance key.voidsetProviderKey(String providerKey) Set the provider key.voidsetValues(List<SettingValueBean> values) Set the values.
-
Constructor Details
-
SettingsCommand
public SettingsCommand()Constructor.The
valuesproperty will be created automatically. -
SettingsCommand
public SettingsCommand(boolean force) Construct with a "forced" setting.This can be useful when configuring an instance from a factory, where the instance only has default settings (and thus no instance settings).
- Parameters:
force- true to force updating the setting
-
SettingsCommand
Constructor.- Parameters:
values- the values, or null to have a list created automatically
-
SettingsCommand
Constructor.- Parameters:
values- the values, or null to have a list created automaticallysettingKeyPatternsToClean- the key patterns to clean, or null
-
-
Method Details
-
hasSettingKeyPatternsToClean
public boolean hasSettingKeyPatternsToClean()Description copied from interface:SettingsUpdatesTest if there are any setting patterns to clean.- Specified by:
hasSettingKeyPatternsToCleanin interfaceSettingsUpdates- Returns:
- false only if
SettingsUpdates.getSettingKeyPatternsToClean()is known not to contain any patterns
-
hasSettingValueUpdates
public boolean hasSettingValueUpdates()Description copied from interface:SettingsUpdatesTest if there are any updates to apply.- Specified by:
hasSettingValueUpdatesin interfaceSettingsUpdates- Returns:
- false only if
SettingsUpdates.getSettingValueUpdates()is known not to contain any patterns
-
getSettingKeyPatternsToClean
Description copied from interface:SettingsUpdatesGet a collection of setting key patterns to clean before apply any setting value updates.- Specified by:
getSettingKeyPatternsToCleanin interfaceSettingsUpdates- Returns:
- the patterns, never null
-
getSettingValueUpdates
Description copied from interface:SettingsUpdatesGet a collection of setting values to apply.- Specified by:
getSettingValueUpdatesin interfaceSettingsUpdates- Returns:
- the setting values, never null
-
getValues
Get the values.- Returns:
- the values
-
setValues
Set the values.- Parameters:
values- the values to set
-
getProviderKey
Get the provider key.- Returns:
- the provider key
-
setProviderKey
Set the provider key.- Parameters:
providerKey- the provider key
-
getInstanceKey
Get the instance key.- Returns:
- the instance key
-
setInstanceKey
Set the instance key.- Parameters:
instanceKey- the instance key to set
-
isForce
public boolean isForce()Get the flag indicating if the update command should be forced, even if there are no setting values.- Returns:
- true if the update should be forced
- Since:
- 1.1
-
setForce
public void setForce(boolean force) Set a flag indicating if the update command should be forced, even if there are no setting values.- Parameters:
force- true if the update should be forced- Since:
- 1.1
-