com.atlassian.crowd.openid.server.model.profile
Class SREGAttributes

java.lang.Object
  extended by com.atlassian.crowd.openid.server.model.profile.SREGAttributes

public class SREGAttributes
extends Object

Stores a map of name-value pairs of attributes defined by the SREG specification. Also provides convenience methods for accessing the attribute values with JavaBean style getters and setters for the attributes. See http://openid.net/specs/openid-simple-registration-extension-1_0.html


Field Summary
static String COUNTRY
           
static String DOB
           
static String EMAIL
           
static String FULLNAME
           
static String GENDER
           
static String LANGUAGE
           
static String NICKNAME
           
static String POSTCODE
           
static String TIMEZONE
           
 
Constructor Summary
SREGAttributes()
           
SREGAttributes(Profile profile)
          Obtain SREG attributes from a profile's attributes.
 
Method Summary
 void addAttribute(String name, String value)
          Safe "put" method to attributes map.
 String getAttribute(String name)
           
static List getAttributeNames()
          Returns of all SREG attribute names.
 Map getAttributes()
           
 String getCountry()
           
 String getDob()
           
 int getDobDay()
           
 int getDobMonth()
           
 int getDobYear()
           
 String getEmail()
           
 String getFullname()
           
 String getGender()
           
 String getLanguage()
           
 String getNickname()
           
 String getPostcode()
           
 String getTimezone()
           
 void setAttributes(Map attributes)
           
 void setCountry(String country)
           
 void setDob(int day, int month, int year)
           
 void setDob(String dob)
           
 void setEmail(String email)
           
 void setFullname(String fullname)
           
 void setGender(String gender)
           
 void setLanguage(String language)
           
 void setNickname(String nickname)
           
 void setPostcode(String postcode)
           
 void setTimezone(String timezone)
           
 Set toAttributes()
          Converts the SREG attributes to a set of Attributes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NICKNAME

public static final String NICKNAME
See Also:
Constant Field Values

EMAIL

public static final String EMAIL
See Also:
Constant Field Values

FULLNAME

public static final String FULLNAME
See Also:
Constant Field Values

DOB

public static final String DOB
See Also:
Constant Field Values

GENDER

public static final String GENDER
See Also:
Constant Field Values

POSTCODE

public static final String POSTCODE
See Also:
Constant Field Values

COUNTRY

public static final String COUNTRY
See Also:
Constant Field Values

LANGUAGE

public static final String LANGUAGE
See Also:
Constant Field Values

TIMEZONE

public static final String TIMEZONE
See Also:
Constant Field Values
Constructor Detail

SREGAttributes

public SREGAttributes()

SREGAttributes

public SREGAttributes(Profile profile)
Obtain SREG attributes from a profile's attributes. Uses attributes from profile which match an SREG attribute name.

Parameters:
profile - profile to search attributes.
Method Detail

addAttribute

public void addAttribute(String name,
                         String value)
Safe "put" method to attributes map. Checks that both the name and value are not blank (ie. not null, not empty, not whitespace).

Parameters:
name - name of attribute.
value - value of attribute.

toAttributes

public Set toAttributes()
Converts the SREG attributes to a set of Attributes.

Returns:
Set

getAttributeNames

public static List getAttributeNames()
Returns of all SREG attribute names.

Returns:
List

getAttribute

public String getAttribute(String name)

getAttributes

public Map getAttributes()

setAttributes

public void setAttributes(Map attributes)

getNickname

public String getNickname()

setNickname

public void setNickname(String nickname)

getEmail

public String getEmail()

setEmail

public void setEmail(String email)

getFullname

public String getFullname()

setFullname

public void setFullname(String fullname)

getDob

public String getDob()

setDob

public void setDob(int day,
                   int month,
                   int year)

getDobDay

public int getDobDay()

getDobMonth

public int getDobMonth()

getDobYear

public int getDobYear()

setDob

public void setDob(String dob)

getPostcode

public String getPostcode()

setPostcode

public void setPostcode(String postcode)

getGender

public String getGender()

setGender

public void setGender(String gender)

getCountry

public String getCountry()

setCountry

public void setCountry(String country)

getLanguage

public String getLanguage()

setLanguage

public void setLanguage(String language)

getTimezone

public String getTimezone()

setTimezone

public void setTimezone(String timezone)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Atlassian. All Rights Reserved.