package com.namelessmc.java_api;

import org.jetbrains.annotations.NotNull;

import com.google.gson.JsonObject;

public class Group implements Comparable<Group> {

	private final int id;
	@NotNull
	private final String name;
	private final int order;
	private final boolean staff;

	Group(@NotNull final JsonObject group) {
		this.id = group.get("id").getAsInt();
		this.name = group.get("name").getAsString();
		this.order = group.get("order").getAsInt();
		this.staff = group.has("staff") && group.get("staff").getAsBoolean();
	}

	public int getId() {
		return this.id;
	}

	@NotNull
	public String getName() {
		return this.name;
	}

	public int getOrder() {
		return this.order;
	}

	public boolean isStaff() {
		return this.staff;
	}

	@Override
	public int compareTo(final Group other) {
		return this.order - other.order;
	}

}

@@ -827,10 +827,228 @@
 er;%0A%09%7D%0A%0A
+%09@Override%0A%09public boolean equals(Object other) %7B%0A%09%09return other instanceof Group &&%0A%09%09%09%09((Group) other).id == this.id;%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return %22Group%5Bid=%22 + id + %22,name=%22 + name + %22%5D%22;%0A%09%7D%0A%0A
 %7D%0A

implement toString and equals