All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mojang.brigadier.ParseResults Maven / Gradle / Ivy

There is a newer version: 1.09.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

package com.mojang.brigadier;

import com.mojang.brigadier.context.CommandContextBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.tree.CommandNode;

import java.util.Collections;
import java.util.Map;

public class ParseResults {
    private final CommandContextBuilder context;
    private final Map, CommandSyntaxException> exceptions;
    private final ImmutableStringReader reader;

    public ParseResults(final CommandContextBuilder context, final ImmutableStringReader reader, final Map, CommandSyntaxException> exceptions) {
        this.context = context;
        this.reader = reader;
        this.exceptions = exceptions;
    }

    public ParseResults(final CommandContextBuilder context) {
        this(context, new StringReader(""), Collections.emptyMap());
    }

    public CommandContextBuilder getContext() {
        return context;
    }

    public ImmutableStringReader getReader() {
        return reader;
    }

    public Map, CommandSyntaxException> getExceptions() {
        return exceptions;
    }
}