Add method to convert a group reference into a configuration value
This remove the last use of GroupReference.PREFIX outside of GroupReference class so make it private. Change-Id: I6e7004b7f899f71227a3954b16f493f00423f190
This commit is contained in:
@@ -20,7 +20,7 @@ import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
/** Describes a group within a projects {@link AccessSection}s. */
|
||||
public class GroupReference implements Comparable<GroupReference> {
|
||||
|
||||
public static final String PREFIX = "group ";
|
||||
private static final String PREFIX = "group ";
|
||||
|
||||
/** @return a new reference to the given group description. */
|
||||
public static GroupReference forGroup(AccountGroup group) {
|
||||
@@ -94,6 +94,10 @@ public class GroupReference implements Comparable<GroupReference> {
|
||||
return o instanceof GroupReference && compareTo((GroupReference) o) == 0;
|
||||
}
|
||||
|
||||
public String toConfigValue() {
|
||||
return PREFIX + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Group[" + getName() + " / " + getUUID() + "]";
|
||||
|
||||
@@ -204,8 +204,7 @@ public class PermissionRule implements Comparable<PermissionRule> {
|
||||
r.append(' ');
|
||||
}
|
||||
|
||||
r.append(GroupReference.PREFIX);
|
||||
r.append(getGroup().getName());
|
||||
r.append(getGroup().toConfigValue());
|
||||
|
||||
return r.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user