Interface ScreenSettings

All Known Implementing Classes:
AbstractScreenSettings, ScreenSettingsJson

public interface ScreenSettings
Base interface for screen settings container. It provides API for putting, getting, removing component settings.
  • Method Details

    • setModified

      void setModified(boolean modified)
      Set to true if screen settings changed manually. It will guarantee that settings will be persisted.
      Parameters:
      modified - whether settings were modified
    • isModified

      boolean isModified()
      Returns:
      true if screen setting were modified
    • put

      ScreenSettings put(String componentId, String property, @Nullable String value)
      Puts a String value. Will replace value if property already exist.
      Parameters:
      componentId - component id
      property - component's property
      value - String value
      Returns:
      current instance of screen settings
    • put

      ScreenSettings put(String componentId, String property, @Nullable Integer value)
      Puts an Integer value. Will replace value if property already exist.
      Parameters:
      componentId - component id
      property - component's property
      value - Integer value
      Returns:
      current instance of screen settings
    • put

      ScreenSettings put(String componentId, String property, @Nullable Long value)
      Puts a Long value. Will replace value if property already exist.
      Parameters:
      componentId - component id
      property - component's property
      value - Long value
      Returns:
      current instance of screen settings
    • put

      ScreenSettings put(String componentId, String property, @Nullable Double value)
      Puts a Double value. Will replace value if property already exist.
      Parameters:
      componentId - component id
      property - component's property
      value - Double value
      Returns:
      current instance of screen settings
    • put

      ScreenSettings put(String componentId, String property, @Nullable Boolean value)
      Puts a Boolean value. Will replace value if property already exist.
      Parameters:
      componentId - component id
      property - component's property
      value - Boolean value
      Returns:
      current instance of screen settings
    • put

      Puts component's settings, e.g TableSettings. If settings with provided id already exist they will be replaced.
      Parameters:
      settings - component settings
      Returns:
      current instance of screen settings
    • remove

      ScreenSettings remove(String componentId)
      Removes component's settings if they exist.
      Parameters:
      componentId - component id to remove
      Returns:
      current instance of screen settings
    • remove

      ScreenSettings remove(String componentId, String property)
      Removes property of component's settings if it exists.
      Parameters:
      componentId - component id
      property - component's property to remove
      Returns:
      current instance of screen settings
    • getString

      Optional<String> getString(String componentId, String property)
      Parameters:
      componentId - component id
      property - component's property
      Returns:
      String value wrapped in Optional
    • getInteger

      Optional<Integer> getInteger(String componentId, String property)
      Parameters:
      componentId - component id
      property - component's property
      Returns:
      Integer value wrapped in Optional
    • getLong

      Optional<Long> getLong(String componentId, String property)
      Parameters:
      componentId - component id
      property - component's property
      Returns:
      Long value wrapped in Optional
    • getDouble

      Optional<Double> getDouble(String componentId, String property)
      Parameters:
      componentId - component id
      property - component's property
      Returns:
      Double value wrapped in Optional
    • getBoolean

      Optional<Boolean> getBoolean(String componentId, String property)
      Parameters:
      componentId - component id
      property - component's property
      Returns:
      Boolean value wrapped in Optional
    • getSettings

      <T extends ComponentSettings> Optional<T> getSettings(String componentId, Class<T> settingsClass)
      Type Parameters:
      T - type of component settings class
      Parameters:
      componentId - component id
      settingsClass - settings class
      Returns:
      component settings wrapped in Optional
    • getSettingsOrCreate

      <T extends ComponentSettings> T getSettingsOrCreate(String componentId, Class<T> settingsClass)
      Type Parameters:
      T - type of component settings class
      Parameters:
      componentId - component id
      settingsClass - settings class
      Returns:
      component settings if exist otherwise return created settings with corresponding id