package xigua.robots.chorddiagram.data;

import java.util.Map;
import java.util.Optional;

public class ParameterParseResult {
    private final String title;
    private final Map<String, String> parameters;

    private ParameterParseResult(String title, Map<String, String> parameters) {
        this.parameters = parameters;
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public Optional<String> getParameter(String name) {
        return Optional.ofNullable(parameters.get(name));
    }

    public static ParameterParseResult of(String title, Map<String, String> parameters) {
        return new ParameterParseResult(title, parameters);
    }
}