com.atlassian.sal.core.usersettings
Class DefaultUserSettings.Builder

java.lang.Object
  extended by com.atlassian.sal.core.usersettings.DefaultUserSettings.Builder
All Implemented Interfaces:
UserSettingsBuilder
Enclosing class:
DefaultUserSettings

public static class DefaultUserSettings.Builder
extends Object
implements UserSettingsBuilder


Method Summary
 UserSettings build()
           
 com.atlassian.fugue.Option<Object> get(String key)
           
 Set<String> getKeys()
           
 UserSettingsBuilder put(String key, boolean value)
          add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)
 UserSettingsBuilder put(String key, long value)
          add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)
 UserSettingsBuilder put(String key, String value)
          add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)
 UserSettingsBuilder remove(String key)
          remove an entry from the builder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

put

public UserSettingsBuilder put(String key,
                               String value)
Description copied from interface: UserSettingsBuilder
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)

Specified by:
put in interface UserSettingsBuilder
Parameters:
key - the key to store the value against
value - the non-null String to store, length cannot be longer than UserSettingsService.MAX_KEY_LENGTH
Returns:
this builder

put

public UserSettingsBuilder put(String key,
                               boolean value)
Description copied from interface: UserSettingsBuilder
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)

Specified by:
put in interface UserSettingsBuilder
Parameters:
key - the key to store the value against
value - the boolean to store
Returns:
this builder

put

public UserSettingsBuilder put(String key,
                               long value)
Description copied from interface: UserSettingsBuilder
add an extra entry to the builder, overwriting any existing value stored against key (regardless of type)

Specified by:
put in interface UserSettingsBuilder
Parameters:
key - the key to store the value against
value - the long to store
Returns:
this builder

remove

public UserSettingsBuilder remove(String key)
Description copied from interface: UserSettingsBuilder
remove an entry from the builder

Specified by:
remove in interface UserSettingsBuilder
Parameters:
key - the key for the entry to remove
Returns:
this builder

get

public com.atlassian.fugue.Option<Object> get(String key)
Specified by:
get in interface UserSettingsBuilder
Parameters:
key - the setting key being queried
Returns:
a Some containing the value stored against key if one exists, a Option.none() otherwise. Values can be of type String, Boolean or Long.

getKeys

public Set<String> getKeys()
Specified by:
getKeys in interface UserSettingsBuilder
Returns:
the set of keys known to this UserSettings

build

public UserSettings build()
Specified by:
build in interface UserSettingsBuilder
Returns:
an immutable UserSettings matching the contents of this builder


Copyright © 2015 Atlassian. All rights reserved.