S - the setting typepublic final class BooleanSettingMapFactory<S extends BooleanSetting> extends Object
BooleanSettingMaps for a given realm of settings.
It is safe to introduce additional settings, so long as the ordinal values of existing ones are not affected.
| Modifier and Type | Method and Description |
|---|---|
static <S extends Enum<S> & BooleanSetting> |
create(Class<S> settingsEnum)
Creates a new
BooleanSettingMapFactory for the given BooleanSetting enum. |
static <S extends BooleanSetting> |
create(S[] settings)
Creates a new
BooleanSettingMapFactory for the given BooleanSettings. |
BooleanSettingMap<S> |
decode(byte[] buf)
Decodes the given byte array to a
BooleanSettingMap. |
BooleanSettingMap<S> |
decode(String encodedString)
Decodes the given string to a
BooleanSettingMap. |
S[] |
getSettings()
Gets the
BooleanSetting instances. |
BooleanSettingMap<S> |
newMap()
Creates a new
BooleanSettingMap, with the default states set for each of the settings. |
public static <S extends Enum<S> & BooleanSetting> BooleanSettingMapFactory<S> create(Class<S> settingsEnum)
BooleanSettingMapFactory for the given BooleanSetting enum.
Factories should ideally be cached (stored in a static field) in the setting enum and reused.
S - the class typesettingsEnum - the setting classpublic static <S extends BooleanSetting> BooleanSettingMapFactory<S> create(S[] settings)
BooleanSettingMapFactory for the given BooleanSettings.
Factories should ideally be cached (stored in a static field) in the setting class.
S - the class typesettings - the settingspublic S[] getSettings()
BooleanSetting instances.public BooleanSettingMap<S> newMap()
BooleanSettingMap, with the default states set for each of the settings.public BooleanSettingMap<S> decode(byte[] buf)
BooleanSettingMap.
Operates on the reverse of BooleanSettingMap.encode().
buf - the byte arraypublic BooleanSettingMap<S> decode(String encodedString)
BooleanSettingMap.
Operates on the reverse of BooleanSettingMap.encodeToString().
encodedString - the stringCopyright © 2020. All rights reserved.