Package com.taskadapter.redmineapi.bean
Class Membership
- java.lang.Object
-
- com.taskadapter.redmineapi.bean.Membership
-
- All Implemented Interfaces:
FluentStyle
,Identifiable
public class Membership extends java.lang.Object implements Identifiable, FluentStyle
User or group membership.
-
-
Field Summary
Fields Modifier and Type Field Description static Property<java.lang.Integer>
DATABASE_ID
database numeric ID.static Property<java.lang.Integer>
GROUP_ID
Group.static Property<java.lang.String>
GROUP_NAME
static Property<Project>
PROJECT
static Property<java.util.Set<Role>>
ROLES
static Property<java.lang.Integer>
USER_ID
User.static Property<java.lang.String>
USER_NAME
-
Constructor Summary
Constructors Constructor Description Membership(Transport transport)
Membership(Transport transport, Project project, int userId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Membership
addRoles(java.util.Collection<Role> roles)
Membership
create()
Required attributes: 1) project 2) either userId/groupId or roles collectionvoid
delete()
this object must have ID property setboolean
equals(java.lang.Object o)
java.lang.Integer
getGroupId()
java.lang.String
getGroupName()
java.lang.Integer
getId()
Project
getProject()
java.util.Collection<Role>
getRoles()
PropertyStorage
getStorage()
java.lang.Integer
getUserId()
java.lang.String
getUserName()
int
hashCode()
void
setGroupId(java.lang.Integer id)
void
setGroupName(java.lang.String id)
Membership
setId(java.lang.Integer id)
Membership
setProject(Project project)
void
setTransport(Transport transport)
Membership
setUserId(java.lang.Integer id)
void
setUserName(java.lang.String id)
java.lang.String
toString()
void
update()
-
-
-
Field Detail
-
DATABASE_ID
public static final Property<java.lang.Integer> DATABASE_ID
database numeric ID.
-
USER_ID
public static final Property<java.lang.Integer> USER_ID
User. Not set for "group" membership.
-
USER_NAME
public static final Property<java.lang.String> USER_NAME
-
GROUP_ID
public static final Property<java.lang.Integer> GROUP_ID
Group. Not set for "user" membership.
-
GROUP_NAME
public static final Property<java.lang.String> GROUP_NAME
-
-
Method Detail
-
setId
public Membership setId(java.lang.Integer id)
- Parameters:
id
- database ID.
-
getId
public java.lang.Integer getId()
- Specified by:
getId
in interfaceIdentifiable
-
getProject
public Project getProject()
-
setProject
public Membership setProject(Project project)
-
getUserId
public java.lang.Integer getUserId()
-
setUserId
public Membership setUserId(java.lang.Integer id)
-
getGroupId
public java.lang.Integer getGroupId()
-
setGroupId
public void setGroupId(java.lang.Integer id)
-
getUserName
public java.lang.String getUserName()
-
setUserName
public void setUserName(java.lang.String id)
-
getGroupName
public java.lang.String getGroupName()
-
setGroupName
public void setGroupName(java.lang.String id)
-
getRoles
public java.util.Collection<Role> getRoles()
-
addRoles
public Membership addRoles(java.util.Collection<Role> roles)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getStorage
public PropertyStorage getStorage()
-
create
public Membership create() throws RedmineException
Required attributes: 1) project 2) either userId/groupId or roles collection- Throws:
RedmineException
-
update
public void update() throws RedmineException
- Throws:
RedmineException
-
delete
public void delete() throws RedmineException
this object must have ID property set- Throws:
RedmineException
-
setTransport
public void setTransport(Transport transport)
- Specified by:
setTransport
in interfaceFluentStyle
-
-