cn.nukkit.command.tree.node.OperatorStringNode Maven / Gradle / Ivy
package cn.nukkit.command.tree.node;
import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import com.google.common.collect.Sets;
import java.util.HashSet;
/**
* 验证是否为操作参数,解析对应参数为{@link String}值
*
* 所有命令参数类型为{@link cn.nukkit.command.data.CommandParamType#OPERATOR OPERATOR}如果没有手动指定{@link IParamNode},则会默认使用这个解析
*/
@PowerNukkitXOnly
@Since("1.19.60-r1")
public class OperatorStringNode extends StringNode {
private static final HashSet OPERATOR = Sets.newHashSet("+=", "-=", "*=", "/=", "%=", "=", "<", ">", "><");
@Override
public void fill(String arg) {
if (OPERATOR.contains(arg)) this.value = arg;
else this.error();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy