com.atlassian.gadgets.spec
Class UserPrefSpec

java.lang.Object
  extended by com.atlassian.gadgets.spec.UserPrefSpec

@Immutable
public final class UserPrefSpec
extends Object

Represents a user pref containing the details from the gadget spec XML


Nested Class Summary
static class UserPrefSpec.Builder
          A builder that facilitates construction of UserPrefSpec objects.
 
Method Summary
 DataType getDataType()
          Returns the DataType of this pref.
 String getDefaultValue()
          Returns the pref's default value.
 String getDisplayName()
          Returns the display name of this parameter.
 Map<String,String> getEnumValues()
          Returns the possible values for an enumerated pref.
 String getName()
          Returns the pref name.
 boolean isRequired()
          Returns true if the pref is required.
 String toString()
           
static UserPrefSpec.Builder userPrefSpec(String name)
          Factory method to create a new builder which can be used to create UserPrefSpec objects.
static UserPrefSpec.Builder userPrefSpec(UserPrefSpec userPrefSpec)
          Factory method which allows you to create a new UserPrefSpec object based on an existing UserPrefSpec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public String getName()
Returns the pref name.

Returns:
the pref name

getDisplayName

public String getDisplayName()
Returns the display name of this parameter.

Returns:
the name to show the user for this pref

isRequired

public boolean isRequired()
Returns true if the pref is required.

Returns:
true if the pref is required

getDataType

public DataType getDataType()
Returns the DataType of this pref.

Returns:
this pref's datatype

getEnumValues

public Map<String,String> getEnumValues()
Returns the possible values for an enumerated pref.

Returns:
possible values for the pref

getDefaultValue

public String getDefaultValue()
Returns the pref's default value.

Returns:
the default value of the pref

userPrefSpec

public static UserPrefSpec.Builder userPrefSpec(String name)
Factory method to create a new builder which can be used to create UserPrefSpec objects. It returns a Builder which allows you to set the user pref spec values.

Parameters:
name - the pref name
Returns:
a Builder which allows you to set the user pref spec values

userPrefSpec

public static UserPrefSpec.Builder userPrefSpec(UserPrefSpec userPrefSpec)
Factory method which allows you to create a new UserPrefSpec object based on an existing UserPrefSpec.

Parameters:
userPrefSpec - the UserPrefSpec to start with when building the new UserPrefSpec
Returns:
a Builder which allows you to set the gadget spec values

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 Atlassian. All Rights Reserved.