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_IDdatabase numeric ID.static Property<java.lang.Integer>GROUP_IDGroup.static Property<java.lang.String>GROUP_NAMEstatic Property<Project>PROJECTstatic Property<java.util.Set<Role>>ROLESstatic Property<java.lang.Integer>USER_IDUser.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 MembershipaddRoles(java.util.Collection<Role> roles)Membershipcreate()Required attributes: 1) project 2) either userId/groupId or roles collectionvoiddelete()this object must have ID property setbooleanequals(java.lang.Object o)java.lang.IntegergetGroupId()java.lang.StringgetGroupName()java.lang.IntegergetId()ProjectgetProject()java.util.Collection<Role>getRoles()PropertyStoragegetStorage()java.lang.IntegergetUserId()java.lang.StringgetUserName()inthashCode()voidsetGroupId(java.lang.Integer id)voidsetGroupName(java.lang.String id)MembershipsetId(java.lang.Integer id)MembershipsetProject(Project project)voidsetTransport(Transport transport)MembershipsetUserId(java.lang.Integer id)voidsetUserName(java.lang.String id)java.lang.StringtoString()voidupdate()
-
-
-
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:
getIdin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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 RedmineExceptionthis object must have ID property set- Throws:
RedmineException
-
setTransport
public void setTransport(Transport transport)
- Specified by:
setTransportin interfaceFluentStyle
-
-