Interface UserSettingsBuilder
public interface UserSettingsBuilder
A builder for
UserSettings-
Method Summary
Modifier and TypeMethodDescriptionbuild()io.atlassian.fugue.Option<Object>getKeys()add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)remove an entry from the builder
-
Method Details
-
put
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)- Parameters:
key- the key to store the value againstvalue- the non-null String to store, length cannot be longer thanUserSettingsService.MAX_KEY_LENGTH- Returns:
- this builder
- Throws:
IllegalArgumentException- if value is null, or value is longer thanUserSettingsService.MAX_STRING_VALUE_LENGTHcharacters, or key is null or longer thanUserSettingsService.MAX_KEY_LENGTHcharacters.
-
put
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)- Parameters:
key- the key to store the value againstvalue- the boolean to store- Returns:
- this builder
- Throws:
IllegalArgumentException- if key is null or longer thanUserSettingsService.MAX_KEY_LENGTHcharacters.
-
put
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)- Parameters:
key- the key to store the value againstvalue- the long to store- Returns:
- this builder
- Throws:
IllegalArgumentException- if key is null or longer thanUserSettingsService.MAX_KEY_LENGTHcharacters.
-
remove
remove an entry from the builder- Parameters:
key- the key for the entry to remove- Returns:
- this builder
- Throws:
IllegalArgumentException- if key is null or longer thanUserSettingsService.MAX_KEY_LENGTHcharacters.
-
get
- Parameters:
key- the setting key being queried- Returns:
- a
Somecontaining the value stored against key if one exists, acom.atlassian.fugue.Option#none()otherwise. Values can be of type String, Boolean or Long. - Throws:
IllegalArgumentException- if key is null or longer thanUserSettingsService.MAX_KEY_LENGTHcharacters.
-
getKeys
- Returns:
- the set of keys known to this UserSettings
-
build
UserSettings build()- Returns:
- an immutable UserSettings matching the contents of this builder
-