package com.namelessmc.java_api;

import com.google.gson.JsonObject;

public class Group implements Comparable<Group> {

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

	Group(final JsonObject group) {
		this.id = group.get("id").getAsInt();
		this.name = group.get("name").getAsString();
		this.order = group.has("order") ? group.get("order").getAsInt() : -1;
		this.staff = group.has("staff") && group.get("staff").getAsBoolean();
	}

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

	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;
	}

}

@@ -360,29 +360,8 @@
 er =
- group.has(%22order%22) ?
  gro
@@ -390,13 +390,8 @@
 nt()
- : -1
 ;%0A%09%09

order is always present in Group