Class SettingsCommand

java.lang.Object
net.solarnetwork.node.settings.SettingsCommand
All Implemented Interfaces:
SettingsUpdates

public class SettingsCommand extends Object implements SettingsUpdates
Edit settings command object.
Version:
1.1
Author:
matt
  • Constructor Details

    • SettingsCommand

      public SettingsCommand()
      Constructor.

      The values property 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

      public SettingsCommand(List<SettingValueBean> values)
      Constructor.
      Parameters:
      values - the values, or null to have a list created automatically
    • SettingsCommand

      public SettingsCommand(List<SettingValueBean> values, Iterable<Pattern> settingKeyPatternsToClean)
      Constructor.
      Parameters:
      values - the values, or null to have a list created automatically
      settingKeyPatternsToClean - the key patterns to clean, or null
  • Method Details

    • hasSettingKeyPatternsToClean

      public boolean hasSettingKeyPatternsToClean()
      Description copied from interface: SettingsUpdates
      Test if there are any setting patterns to clean.
      Specified by:
      hasSettingKeyPatternsToClean in interface SettingsUpdates
      Returns:
      false only if SettingsUpdates.getSettingKeyPatternsToClean() is known not to contain any patterns
    • hasSettingValueUpdates

      public boolean hasSettingValueUpdates()
      Description copied from interface: SettingsUpdates
      Test if there are any updates to apply.
      Specified by:
      hasSettingValueUpdates in interface SettingsUpdates
      Returns:
      false only if SettingsUpdates.getSettingValueUpdates() is known not to contain any patterns
    • getSettingKeyPatternsToClean

      public Iterable<Pattern> getSettingKeyPatternsToClean()
      Description copied from interface: SettingsUpdates
      Get a collection of setting key patterns to clean before apply any setting value updates.
      Specified by:
      getSettingKeyPatternsToClean in interface SettingsUpdates
      Returns:
      the patterns, never null
    • getSettingValueUpdates

      public Iterable<? extends SettingsUpdates.Change> getSettingValueUpdates()
      Description copied from interface: SettingsUpdates
      Get a collection of setting values to apply.
      Specified by:
      getSettingValueUpdates in interface SettingsUpdates
      Returns:
      the setting values, never null
    • getValues

      public List<SettingValueBean> getValues()
      Get the values.
      Returns:
      the values
    • setValues

      public void setValues(List<SettingValueBean> values)
      Set the values.
      Parameters:
      values - the values to set
    • getProviderKey

      public String getProviderKey()
      Get the provider key.
      Returns:
      the provider key
    • setProviderKey

      public void setProviderKey(String providerKey)
      Set the provider key.
      Parameters:
      providerKey - the provider key
    • getInstanceKey

      public String getInstanceKey()
      Get the instance key.
      Returns:
      the instance key
    • setInstanceKey

      public void setInstanceKey(String instanceKey)
      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