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 java.lang.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 java.lang.String COUNTRY
           
static java.lang.String DOB
           
static java.lang.String EMAIL
           
static java.lang.String FULLNAME
           
static java.lang.String GENDER
           
static java.lang.String LANGUAGE
           
static java.lang.String NICKNAME
           
static java.lang.String POSTCODE
           
static java.lang.String TIMEZONE
           
 
Constructor Summary
SREGAttributes()
           
SREGAttributes(Profile profile)
          Obtain SREG attributes from a profile's attributes.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Safe "put" method to attributes map.
 java.lang.String getAttribute(java.lang.String name)
           
static java.util.List getAttributeNames()
          Returns of all SREG attribute names.
 java.util.Map getAttributes()
           
 java.lang.String getCountry()
           
 java.lang.String getDob()
           
 int getDobDay()
           
 int getDobMonth()
           
 int getDobYear()
           
 java.lang.String getEmail()
           
 java.lang.String getFullname()
           
 java.lang.String getGender()
           
 java.lang.String getLanguage()
           
 java.lang.String getNickname()
           
 java.lang.String getPostcode()
           
 java.lang.String getTimezone()
           
 void setAttributes(java.util.Map attributes)
           
 void setCountry(java.lang.String country)
           
 void setDob(int day, int month, int year)
           
 void setDob(java.lang.String dob)
           
 void setEmail(java.lang.String email)
           
 void setFullname(java.lang.String fullname)
           
 void setGender(java.lang.String gender)
           
 void setLanguage(java.lang.String language)
           
 void setNickname(java.lang.String nickname)
           
 void setPostcode(java.lang.String postcode)
           
 void setTimezone(java.lang.String timezone)
           
 java.util.Set toAttributes()
          Converts the SREG attributes to a set of Attributes.
 java.lang.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 java.lang.String NICKNAME
See Also:
Constant Field Values

EMAIL

public static final java.lang.String EMAIL
See Also:
Constant Field Values

FULLNAME

public static final java.lang.String FULLNAME
See Also:
Constant Field Values

DOB

public static final java.lang.String DOB
See Also:
Constant Field Values

GENDER

public static final java.lang.String GENDER
See Also:
Constant Field Values

POSTCODE

public static final java.lang.String POSTCODE
See Also:
Constant Field Values

COUNTRY

public static final java.lang.String COUNTRY
See Also:
Constant Field Values

LANGUAGE

public static final java.lang.String LANGUAGE
See Also:
Constant Field Values

TIMEZONE

public static final java.lang.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(java.lang.String name,
                         java.lang.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 java.util.Set toAttributes()
Converts the SREG attributes to a set of Attributes.

Returns:
Set

getAttributeNames

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

Returns:
List

getAttribute

public java.lang.String getAttribute(java.lang.String name)

getAttributes

public java.util.Map getAttributes()

setAttributes

public void setAttributes(java.util.Map attributes)

getNickname

public java.lang.String getNickname()

setNickname

public void setNickname(java.lang.String nickname)

getEmail

public java.lang.String getEmail()

setEmail

public void setEmail(java.lang.String email)

getFullname

public java.lang.String getFullname()

setFullname

public void setFullname(java.lang.String fullname)

getDob

public java.lang.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(java.lang.String dob)

getPostcode

public java.lang.String getPostcode()

setPostcode

public void setPostcode(java.lang.String postcode)

getGender

public java.lang.String getGender()

setGender

public void setGender(java.lang.String gender)

getCountry

public java.lang.String getCountry()

setCountry

public void setCountry(java.lang.String country)

getLanguage

public java.lang.String getLanguage()

setLanguage

public void setLanguage(java.lang.String language)

getTimezone

public java.lang.String getTimezone()

setTimezone

public void setTimezone(java.lang.String timezone)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.