package protocolsupport.protocol.utils.authlib;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty;

public class GameProfile {

	private final UUID uuid;
	private final String name;
	private final HashMap<String, ProfileProperty> properties = new HashMap<>();

	public GameProfile(UUID uuid, String name) {
		if (uuid == null && name == null) {
			throw new IllegalArgumentException("Both name and uuid can't be null");
		}
		this.uuid = uuid;
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public UUID getUUID() {
		return uuid;
	}

	public Map<String, ProfileProperty> getProperties() {
		return new HashMap<>(properties);
	}

	public boolean hasProperty(String name) {
		return properties.containsKey(name);
	}

	public void removeProperty(String name) {
		properties.remove(name);
	}

	public void addProperty(ProfileProperty property) {
		properties.put(property.getName(), property);
	}

	public void clearProperties() {
		properties.clear();
	}

}

@@ -42,16 +42,48 @@
 thlib;%0A%0A
+import java.text.MessageFormat;%0A
 import j
@@ -1104,10 +1104,128 @@
 ();%0A%09%7D%0A%0A
+%09@Override%0A%09public String toString() %7B%0A%09%09return MessageFormat.format(%22GameProfile(id=%7B0%7D,name=%7B1%7D)%22, uuid, name);%0A%09%7D%0A%0A
 %7D%0A

Implement toString for GameProfile