package com.atlassian.stash.internal.hook;

import com.atlassian.bitbucket.hook.HookRequest;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;

import static java.util.Objects.requireNonNull;

/**
 * @since 2.0
 */
public class DefaultHookRequest implements HookRequest {

    private final String name;
    private CharSequence input;
    private final List<String> arguments;

    public DefaultHookRequest(@Nullable String name, @Nonnull List<String> arguments, @Nonnull CharSequence input) {
        this.name = name;
        this.arguments = requireNonNull(arguments, "arguments");
        this.input = requireNonNull(input, "input");
    }

    @Nonnull
    @Override
    public List<String> getArguments() {
        return arguments;
    }

    @Nullable
    @Override
    public String getHookName() {
        return name;
    }

    @Nonnull
    @Override
    public CharSequence getInput() {
        return input;
    }
}
