public interface PreferencesManager
Modifier and Type | Method and Description |
---|---|
Preferences |
getPreferences()
Returns the
Preferences instance contained by this manager. |
void |
injectPreferences(Object instance)
Loads a matching
PreferencesNode into the target instance. |
void |
save(Object instance)
Merges all fields/properties annotated with
@Preference to their
corresponding PreferencesNode within the contained Preferences . |
@Nonnull Preferences getPreferences()
Preferences
instance contained by this manager.
Never returns null.Preferences
instance contained by this manager.void injectPreferences(@Nonnull Object instance)
PreferencesNode
into the target instance.instance
- an object with fields/properties annotated with @Preference
.void save(@Nonnull Object instance)
Merges all fields/properties annotated with @Preference
to their
corresponding PreferencesNode
within the contained Preferences
.
Values will be transformed their literal representation if a format
is present in their @Preference
annotation. Null values will cause
the removal of the key in the PreferencesNode
.
instance
- an object with fields/properties annotated with @Preference
.