Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.security;
 
A public or private group of users. A group may be of the following types:
  • Open Activity is public, and users can self join.
  • Closed Some activity is public, users must be invited.
  • Private Activity and membership is private, users must be invited.
public class Group implements QueryResultComparable<Group>{
	private UUID uuid;
	private String name;

0=open, 1=closed, 2=private
	private int type;
	public Group(UUID uuidString nameint type) {
		this. = uuid;
		this. = name;
		this. = type;
	}
	public UUID getUuid() {
		return ;
	}
	public void setUuid(UUID uuid) {
		this. = uuid;
	}
	public String getName() {
		return ;
	}
	public void setName(String name) {
		this. = name;
	}

Group type. 0=open, 1=closed, 2=private
	public int getType() {
		return ;
	}

Update group type. 0=open, 1=closed, 2=private
	public void setType(int type) {
		this. = type;
	}
	public String toString() {
		return toJson();
	}
	public String toJson() {
		return "{" +
				"\"uuid\":\"" +  + "\"," +
				"\"name\":\"" + Json.escape() + "\"," +
				"\"type\":" +  + "" +
				"}";
	}
	public int compareTo(Group o) {
		int i = .compareTo(o.getName());
		if(i != 0) {
			return i;
		}
		return .compareTo(o.getUuid());
	}
New to GrepCode? Check out our FAQ X