Permalink
Browse files

Changed group attribute from membershipType to Type

This is done to match the SCIM spec.

[#40653593]

Change-Id: I477515dc997d6161d635b8543641d93e93f48e79
  • Loading branch information...
joeldsa committed Nov 26, 2012
1 parent cb7e2f3 commit e5d1f581061172fda0f3f4f72ca2329ec08a72a4
@@ -39,29 +39,29 @@
String display;
- public static enum MembershipType { DIRECT, INDIRECT };
- MembershipType membershipType;
+ public static enum Type { DIRECT, INDIRECT };
+ Type type;
- public MembershipType getMembershipType() {
- return membershipType;
+ public Type getType() {
+ return type;
}
- public void setMembershipType(MembershipType membershipType) {
- this.membershipType = membershipType;
+ public void setType(Type type) {
+ this.type = type;
}
public Group() {
this(null, null);
}
public Group(String value, String display) {
- this(value, display, MembershipType.DIRECT);
+ this(value, display, Type.DIRECT);
}
- public Group(String value, String display, MembershipType type) {
+ public Group(String value, String display, Type type) {
this.value = value;
this.display = display;
- this.membershipType = type;
+ this.type = type;
}
public String getValue() {
@@ -86,7 +86,7 @@ public int hashCode() {
int result = 1;
result = prime * result + ((display == null) ? 0 : display.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
- result = prime * result + ((membershipType == null) ? 0 : membershipType.hashCode());
+ result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
@@ -111,12 +111,12 @@ else if (!display.equals(other.display))
}
else if (!value.equals(other.value))
return false;
- return membershipType == other.membershipType;
+ return type == other.type;
}
@Override
public String toString() {
- return String.format("(id: %s, name: %s, type: %s)", value, display, membershipType);
+ return String.format("(id: %s, name: %s, type: %s)", value, display, type);
}
}
@@ -251,10 +251,10 @@ private ScimUser syncGroups(ScimUser user) {
indirectGroups.removeAll(directGroups);
Set<ScimUser.Group> groups = new HashSet<ScimUser.Group>();
for (ScimGroup group : directGroups) {
- groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.MembershipType.DIRECT));
+ groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.Type.DIRECT));
}
for (ScimGroup group : indirectGroups) {
- groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.MembershipType.INDIRECT));
+ groups.add(new ScimUser.Group(group.getId(), group.getDisplayName(), ScimUser.Group.Type.INDIRECT));
}
user.setGroups(groups);

0 comments on commit e5d1f58

Please sign in to comment.