public final class PSMember extends Object implements PSEntity
The public identifier for a member is the username.
Constructor and Description |
---|
PSMember()
Construct a new member without an ID or username.
|
PSMember(Long id)
Construct a new member with the specified ID.
|
PSMember(String username)
Construct a new member with the specified username.
|
Modifier and Type | Method and Description |
---|---|
EntityValidity |
checkValid()
Known constraints on Member are based on SQL definition:
|
String |
getEmail() |
String |
getFirstname() |
Long |
getId() |
String |
getIdentifier()
Returns the identifier to use when connecting to PageSeeder based on the ID available.
|
String |
getKey() |
String |
getSurname() |
String |
getUsername() |
boolean |
isActivated() |
boolean |
isIdentifiable()
Determines whether the entity can be identified in PageSeeder.
|
boolean |
isValid()
Determines whether the entity is valid based on known PageSeeder constraints.
|
void |
setActivated(boolean activated) |
void |
setEmail(String email) |
void |
setFirstname(String firstname) |
void |
setId(Long id) |
void |
setSurname(String surname) |
void |
setUsername(String username) |
String |
toString() |
public PSMember()
public PSMember(Long id)
id
- The ID of the member.public PSMember(String username)
username
- The username of the member.public Long getId()
public String getKey()
public boolean isIdentifiable()
PSEntity
To be identifiable, the entity must have either a private id or a public id.
If the public ID does not correspond to a single attribute in PageSeeder, then a combination of attributes may be used to determine whether it is possible to identify the entity.
isIdentifiable
in interface PSEntity
true
if the object can be identified in PageSeeder;
false
if it is not possible to identify the entity form its attributes or keys.public String getIdentifier()
PSEntity
When both the private and public identifier are available, the private identifier takes precedence over the public one.
When the public identifier cannot be used on its own, then only the private ID is returned.
In general, if the PSEntity.isIdentifiable()
method return true
, this
method should return a value. When it is not the case, it should be clearly documented.
getIdentifier
in interface PSEntity
public String getFirstname()
public String getSurname()
public String getUsername()
public String getEmail()
public boolean isActivated()
public void setId(Long id)
id
- the id to setpublic void setUsername(String username)
username
- the username to setpublic void setFirstname(String firstname)
firstname
- the firstname to setpublic void setSurname(String surname)
surname
- the surname to setpublic void setActivated(boolean activated)
activated
- the activated to setpublic void setEmail(String email)
email
- the email to setpublic EntityValidity checkValid()
FirstName VARCHAR(20) NULL Surname VARCHAR(20) NULL Email VARCHAR(100) NULL Username VARCHAR(100) NULLDetermines whether this object is valid based on known PageSeeder constraints.
checkValid
in interface PSEntity
true
if the object is intrinsically valid based on its internal values;
false
if any of its attributes violates a PageSeeder constraint.public boolean isValid()
PSEntity
Copyright © 2016 Allette Systems. All rights reserved.