Package io.jmix.appsettings.impl
Class AppSettingsImpl
java.lang.Object
io.jmix.appsettings.impl.AppSettingsImpl
- All Implemented Interfaces:
AppSettings
-
Field Summary
Modifier and TypeFieldDescriptionprotected AppSettingsTools
protected UnconstrainedDataManager
protected DatatypeRegistry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends AppSettingsEntity>
TgetAppSettingsEntity
(Class<T> clazz) protected <T extends AppSettingsEntity>
List<String>getPropertyNames
(Class<T> clazz) <T extends AppSettingsEntity>
TLoads application settings entity of typeT
.<T extends AppSettingsEntity>
voidsave
(T settingsEntityToSave) Saves application settings entity of typeT
.protected <T extends AppSettingsEntity>
voidsaveAppSettingsEntity
(T settingsEntity) protected <T extends AppSettingsEntity>
voidsetDefaultValuesForMissingProperties
(T settingsEntity, List<String> propertyNames) Enriches providedsettingsEntity
with setting up default values for properties with null values.protected <T extends AppSettingsEntity>
voidupdatePropertyValues
(T srcSettingsEntity, T dstSettingsEntity, List<String> propertyNames) Update all non-system properties ofdstSettingsEntity
based on providedsrcSettingsEntity
.
-
Field Details
-
dataManager
-
datatypeRegistry
-
appSettingsTools
-
-
Constructor Details
-
AppSettingsImpl
public AppSettingsImpl()
-
-
Method Details
-
load
Description copied from interface:AppSettings
Loads application settings entity of typeT
. Note, that in default implementation attributes with empty values will be replaced with default values if specified.- Specified by:
load
in interfaceAppSettings
- Parameters:
clazz
- class of entity that extendsAppSettingsEntity
-
save
Description copied from interface:AppSettings
Saves application settings entity of typeT
. Note, that in default implementation attributes with values equal to default will be overridden with null value.- Specified by:
save
in interfaceAppSettings
- Parameters:
settingsEntityToSave
- entity to be saved
-
getAppSettingsEntity
-
saveAppSettingsEntity
-
getPropertyNames
-
setDefaultValuesForMissingProperties
protected <T extends AppSettingsEntity> void setDefaultValuesForMissingProperties(T settingsEntity, List<String> propertyNames) Enriches providedsettingsEntity
with setting up default values for properties with null values.- Parameters:
settingsEntity
- entity to be enrichedpropertyNames
- all non-system properties ofT
-
updatePropertyValues
protected <T extends AppSettingsEntity> void updatePropertyValues(T srcSettingsEntity, T dstSettingsEntity, List<String> propertyNames) Update all non-system properties ofdstSettingsEntity
based on providedsrcSettingsEntity
. Note, that if value of some property insrcSettingsEntity
are equal to default value it will be overridden with null value indstSettingsEntity
.- Parameters:
srcSettingsEntity
- provided entity to savedstSettingsEntity
- entity to be updated and actually savedpropertyNames
- all non-system properties ofT
-