Changeset 14:629e15b345aa in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/Actor.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/Actor.java
r13 r14 8 8 /** 9 9 * @author casties 10 * 10 * 11 11 */ 12 12 public abstract class Actor { … … 15 15 public String name; 16 16 public String id; 17 17 18 18 /** 19 19 * @return if this Actor is a Group 20 20 */ 21 21 public abstract boolean isGroup(); 22 22 23 /** 24 * Returns if this Actor is equivalent to an Actor with this id. If this is 25 * a Group returns true when the Person is in the Group. 26 * 27 * @param userId 28 * @return 29 */ 30 public boolean isEquivalentWith(String userId) { 31 if (userId == null) return false; 32 if (userId.equals(getIdString())) { 33 return true; 34 } 35 if (isGroup()) { 36 // TODO: check if person in group 37 } 38 return false; 39 } 40 23 41 /** 24 42 * @return the uri … … 34 52 */ 35 53 public String getUriString() { 36 37 38 54 if (uri == null) { 55 return getUriFromId(id, isGroup()); 56 } 39 57 return uri; 40 58 } 41 59 42 60 /** 43 * @param uri the uri to set 61 * @param uri 62 * the uri to set 44 63 */ 45 64 public void setUri(String uri) { 46 65 this.uri = uri; 47 66 } 67 48 68 /** 49 69 * @return the name … … 52 72 return name; 53 73 } 74 54 75 /** 55 * @param name the name to set 76 * @param name 77 * the name to set 56 78 */ 57 79 public void setName(String name) { … … 65 87 return id; 66 88 } 67 89 68 90 /** 69 91 * Returns id as a String starting with "group:" for groups. … … 72 94 */ 73 95 public abstract String getIdString(); 74 96 75 97 /** 76 * @param id the id to set 98 * @param id 99 * the id to set 77 100 */ 78 101 public void setId(String id) { 79 102 this.id = id; 80 103 } 81 104 82 105 /** 83 106 * Returns a short id from an uri. … … 110 133 prefix = NS.MPIWG_GROUPS_URL; 111 134 } 112 if (id != null && ! 113 uri = prefix + id; 135 if (id != null && !id.startsWith("http://")) { 136 uri = prefix + id; 114 137 } 115 138 return uri;
Note: See TracChangeset
for help on using the changeset viewer.