package com.ne0nx3r0.betteralias.alias; import java.util.HashMap; import java.util.List; public class Alias { private final String command; private final String permission; private final HashMap> parameters; public Alias(String commandName) { this.command = commandName; this.permission = null; this.parameters = new HashMap>(); } public Alias(String commandName,String permissionNode) { this.command = commandName; this.permission = permissionNode; this.parameters = new HashMap>(); } public boolean hasCommandFor(int length) { return this.parameters.containsKey(length) || this.parameters.containsKey(-1); } public String getPermissionNode() { return this.permission; } public boolean hasPermission() { return this.permission != null; } Iterable getCommands(int length) { List commands = this.parameters.get(length); if(commands != null) { return commands; } return this.parameters.get(-1); } void setCommandsFor(int length,List commandsList) { this.parameters.put(length, commandsList); } }