public class User extends java.lang.Object implements Identifiable, FluentStyle
Modifier and Type | Field and Description |
---|---|
static Property<java.lang.String> |
API_KEY |
static Property<java.lang.Integer> |
AUTH_SOURCE_ID |
static Property<java.util.Date> |
CREATED_ON |
static Property<java.util.Set<CustomField>> |
CUSTOM_FIELDS |
static Property<java.lang.String> |
FIRST_NAME |
static Property<java.lang.Boolean> |
GENERATE_PASSWORD |
static Property<java.util.Set<Group>> |
GROUPS |
static Property<java.lang.Integer> |
ID |
static Property<java.util.Date> |
LAST_LOGIN_ON |
static Property<java.lang.String> |
LAST_NAME |
static Property<java.lang.String> |
LOGIN |
static Property<java.lang.String> |
MAIL |
static Property<java.lang.String> |
MAIL_NOTIFICATION |
static Property<java.util.Set<Membership>> |
MEMBERSHIP |
static Property<java.lang.Boolean> |
MUST_CHANGE_PASSWD |
static Property<java.lang.String> |
PASSWORD |
static Property<java.lang.Integer> |
STATUS |
static java.lang.Integer |
STATUS_ACTIVE |
static java.lang.Integer |
STATUS_ANONYMOUS |
static java.lang.Integer |
STATUS_LOCKED |
static java.lang.Integer |
STATUS_REGISTERED |
Modifier and Type | Method and Description |
---|---|
User |
addCustomField(CustomField customField)
If there is a custom field with the same ID already present,
the new field replaces the old one.
|
User |
addCustomFields(java.util.Collection<CustomField> customFields)
NOTE: The custom field(s) must have correct database ID set to be saved to Redmine.
|
User |
addGroups(java.util.Collection<Group> groups) |
User |
addMemberships(java.util.Collection<Membership> memberships) |
void |
clearCustomFields() |
User |
create() |
void |
delete()
The user object must have ID set.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getApiKey() |
java.lang.Integer |
getAuthSourceId()
Deprecated.
|
java.util.Date |
getCreatedOn() |
java.lang.String |
getCustomField(java.lang.String fieldName) |
java.util.Collection<CustomField> |
getCustomFields() |
java.lang.String |
getFirstName() |
java.lang.String |
getFullName() |
java.util.Collection<Group> |
getGroups() |
java.lang.Integer |
getId() |
java.util.Date |
getLastLoginOn() |
java.lang.String |
getLastName() |
java.lang.String |
getLogin() |
java.lang.String |
getMail()
This field is empty when using issues.get(i).getAssignee().getMail()
|
java.util.Collection<Membership> |
getMemberships() |
java.lang.String |
getPassword() |
java.lang.Integer |
getStatus()
This field is visible to Admin only.
|
PropertyStorage |
getStorage() |
int |
hashCode() |
User |
setApiKey(java.lang.String apiKey)
Deprecated.
|
User |
setAuthSourceId(java.lang.Integer authSource) |
User |
setCreatedOn(java.util.Date createdOn) |
User |
setFirstName(java.lang.String firstName) |
User |
setFullName(java.lang.String fullName)
This is a BIG HACK just to workaround Redmine REST API limitation.
|
User |
setGeneratePassword(java.lang.Boolean generatePassword) |
User |
setId(int id) |
User |
setLastLoginOn(java.util.Date lastLoginOn) |
User |
setLastName(java.lang.String lastName) |
User |
setLogin(java.lang.String login) |
User |
setMail(java.lang.String mail) |
User |
setMailNotification(java.lang.String mailNotification) |
User |
setMustChangePasswd(java.lang.Boolean mustChangePasswd) |
User |
setPassword(java.lang.String password) |
User |
setStatus(java.lang.Integer status)
Sets the user status.
|
void |
setTransport(Transport transport) |
java.lang.String |
toString() |
void |
update() |
public static final java.lang.Integer STATUS_ANONYMOUS
public static final java.lang.Integer STATUS_ACTIVE
public static final java.lang.Integer STATUS_REGISTERED
public static final java.lang.Integer STATUS_LOCKED
public static final Property<java.lang.Integer> ID
public static final Property<java.lang.String> LOGIN
public static final Property<java.lang.String> PASSWORD
public static final Property<java.lang.String> FIRST_NAME
public static final Property<java.lang.String> LAST_NAME
public static final Property<java.lang.String> MAIL
public static final Property<java.lang.String> API_KEY
public static final Property<java.util.Date> CREATED_ON
public static final Property<java.util.Date> LAST_LOGIN_ON
public static final Property<java.lang.Integer> AUTH_SOURCE_ID
public static final Property<java.lang.Integer> STATUS
public static final Property<java.lang.String> MAIL_NOTIFICATION
public static final Property<java.lang.Boolean> MUST_CHANGE_PASSWD
public static final Property<java.lang.Boolean> GENERATE_PASSWORD
public static final Property<java.util.Set<CustomField>> CUSTOM_FIELDS
public static final Property<java.util.Set<Membership>> MEMBERSHIP
public User(Transport transport)
public User setId(int id)
public java.lang.Integer getId()
getId
in interface Identifiable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getLogin()
public User setLogin(java.lang.String login)
public java.lang.String getFirstName()
public User setFirstName(java.lang.String firstName)
public java.lang.String getLastName()
public User setLastName(java.lang.String lastName)
public java.lang.String getMail()
public User setMail(java.lang.String mail)
public java.util.Date getCreatedOn()
public User setCreatedOn(java.util.Date createdOn)
public java.util.Date getLastLoginOn()
public User setLastLoginOn(java.util.Date lastLoginOn)
public java.lang.String getApiKey()
@Deprecated public User setApiKey(java.lang.String apiKey)
@Deprecated public java.lang.Integer getAuthSourceId()
public User setAuthSourceId(java.lang.Integer authSource)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getFullName()
public User setFullName(java.lang.String fullName)
public java.lang.String getPassword()
public User setPassword(java.lang.String password)
public java.lang.String getCustomField(java.lang.String fieldName)
public java.util.Collection<CustomField> getCustomFields()
public void clearCustomFields()
public User addCustomFields(java.util.Collection<CustomField> customFields)
public User addCustomField(CustomField customField)
customField
- the field to add.public java.util.Collection<Membership> getMemberships()
public User addMemberships(java.util.Collection<Membership> memberships)
public java.util.Collection<Group> getGroups()
public java.lang.Integer getStatus()
Returns the user status. This number can theoretically be different for different Redmine versions, But the **current Redmine version in 2018** defines these numbers as:
see http://www.redmine.org/projects/redmine/repository/entry/trunk/app/models/principal.rb#L22-25
public User setStatus(java.lang.Integer status)
status
- STATUS_ACTIVE
, STATUS_LOCKED
, etc...public User setMailNotification(java.lang.String mailNotification)
public User setMustChangePasswd(java.lang.Boolean mustChangePasswd)
public User setGeneratePassword(java.lang.Boolean generatePassword)
public PropertyStorage getStorage()
public void setTransport(Transport transport)
setTransport
in interface FluentStyle
public User create() throws RedmineException
RedmineException
public void update() throws RedmineException
RedmineException
public void delete() throws RedmineException
RedmineException