com.mojang.brigadier.builder.LiteralArgumentBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of khl Show documentation
Show all versions of khl Show documentation
Java sdk for Kaiheila bot development
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package com.mojang.brigadier.builder;
import com.mojang.brigadier.tree.CommandNode;
import com.mojang.brigadier.tree.LiteralCommandNode;
public class LiteralArgumentBuilder extends ArgumentBuilder> {
private final String literal;
protected LiteralArgumentBuilder(final String literal) {
this.literal = literal;
}
public static LiteralArgumentBuilder literal(final String name) {
return new LiteralArgumentBuilder<>(name);
}
@Override
protected LiteralArgumentBuilder getThis() {
return this;
}
public String getLiteral() {
return literal;
}
@Override
public LiteralCommandNode build() {
final LiteralCommandNode result = new LiteralCommandNode<>(getLiteral(), getCommand(), getRequirement(), getRedirect(), getRedirectModifier(), isFork());
for (final CommandNode argument : getArguments()) {
result.addChild(argument);
}
return result;
}
}