Class AppSettingsImpl

java.lang.Object
io.jmix.appsettings.impl.AppSettingsImpl
All Implemented Interfaces:
AppSettings

@Component("appset_AppSettings") public class AppSettingsImpl extends Object implements AppSettings
  • Field Details

  • Constructor Details

    • AppSettingsImpl

      public AppSettingsImpl()
  • Method Details

    • load

      public <T extends AppSettingsEntity> T load(Class<T> clazz)
      Description copied from interface: AppSettings
      Loads application settings entity of type T. Note, that in default implementation attributes with empty values will be replaced with default values if specified.
      Specified by:
      load in interface AppSettings
      Parameters:
      clazz - class of entity that extends AppSettingsEntity
    • save

      public <T extends AppSettingsEntity> void save(T settingsEntityToSave)
      Description copied from interface: AppSettings
      Saves application settings entity of type T. Note, that in default implementation attributes with values equal to default will be overridden with null value.
      Specified by:
      save in interface AppSettings
      Parameters:
      settingsEntityToSave - entity to be saved
    • getAppSettingsEntity

      protected <T extends AppSettingsEntity> T getAppSettingsEntity(Class<T> clazz)
    • saveAppSettingsEntity

      protected <T extends AppSettingsEntity> void saveAppSettingsEntity(T settingsEntity)
    • getPropertyNames

      protected <T extends AppSettingsEntity> List<String> getPropertyNames(Class<T> clazz)
    • setDefaultValuesForMissingProperties

      protected <T extends AppSettingsEntity> void setDefaultValuesForMissingProperties(T settingsEntity, List<String> propertyNames)
      Enriches provided settingsEntity with setting up default values for properties with null values.
      Parameters:
      settingsEntity - entity to be enriched
      propertyNames - all non-system properties of T
    • updatePropertyValues

      protected <T extends AppSettingsEntity> void updatePropertyValues(T srcSettingsEntity, T dstSettingsEntity, List<String> propertyNames)
      Update all non-system properties of dstSettingsEntity based on provided srcSettingsEntity. Note, that if value of some property in srcSettingsEntity are equal to default value it will be overridden with null value in dstSettingsEntity.
      Parameters:
      srcSettingsEntity - provided entity to save
      dstSettingsEntity - entity to be updated and actually saved
      propertyNames - all non-system properties of T