com.almworks.jira.structure.api
Class PermissionSubject.JiraUser

java.lang.Object
  extended by com.almworks.jira.structure.api.PermissionSubject
      extended by com.almworks.jira.structure.api.PermissionSubject.JiraUser
All Implemented Interfaces:
Cloneable
Enclosing class:
PermissionSubject

public static class PermissionSubject.JiraUser
extends PermissionSubject

Represents a specific user in JIRA, matching only that user.

A user is identified by the user key, introduced in JIRA 6. This is different from structure-api 7.x, which used user name as the ID. As a result, serialized permission subjects from JIRA 5.x may not correctly deserialize with this new version of the API - migration is needed. See StructureUtil.migrateUserNameToUserKey(String).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.almworks.jira.structure.api.PermissionSubject
PermissionSubject.Anyone, PermissionSubject.JiraGroup, PermissionSubject.JiraUser, PermissionSubject.ProjectRole, PermissionSubject.Visitor<T>
 
Constructor Summary
PermissionSubject.JiraUser()
           
PermissionSubject.JiraUser(String userKey)
           
PermissionSubject.JiraUser(com.atlassian.crowd.embedded.api.User user)
           
 
Method Summary
 boolean equals(Object o)
           
 String getUserKey()
           
 String getUserName()
           
 int hashCode()
           
 boolean matches(com.atlassian.crowd.embedded.api.User user)
          Used to check whether a user matches this subject.
 void setUserKey(String userKey)
           
 void setUserName(String userName)
           
 String toEncodedString()
           
<T> T
visit(PermissionSubject.Visitor<T> visitor, T carry)
          Calls an appropriate visitor method, passing this PermissionSubject and the carry parameter.
 
Methods inherited from class com.almworks.jira.structure.api.PermissionSubject
clone, clone, fromEncodedString, fromEncodedString, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PermissionSubject.JiraUser

public PermissionSubject.JiraUser()

PermissionSubject.JiraUser

public PermissionSubject.JiraUser(@Nullable
                                  String userKey)

PermissionSubject.JiraUser

public PermissionSubject.JiraUser(@Nullable
                                  com.atlassian.crowd.embedded.api.User user)
Method Detail

getUserName

@Nullable
public String getUserName()

getUserKey

@Nullable
public String getUserKey()

setUserName

public void setUserName(@Nullable
                        String userName)

setUserKey

public void setUserKey(@Nullable
                       String userKey)

matches

public boolean matches(com.atlassian.crowd.embedded.api.User user)
Description copied from class: PermissionSubject
Used to check whether a user matches this subject.

Specified by:
matches in class PermissionSubject
Parameters:
user - user to check, null means anonymous
Returns:
true if the user matches

toEncodedString

public String toEncodedString()
Specified by:
toEncodedString in class PermissionSubject
Returns:
a string representation of this permission subject
See Also:
PermissionSubject.fromEncodedString(java.lang.String)

visit

public <T> T visit(PermissionSubject.Visitor<T> visitor,
                   T carry)
Description copied from class: PermissionSubject
Calls an appropriate visitor method, passing this PermissionSubject and the carry parameter.

Specified by:
visit in class PermissionSubject
Returns:
the result of the call

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013 ALMWorks. All Rights Reserved.