package com.atlassian.bitbucket.mesh.git.hook.handler;

import com.atlassian.bitbucket.mesh.git.hook.GitHook;
import com.atlassian.bitbucket.mesh.git.hook.GitHookHandler;

import javax.annotation.Nonnull;

import static java.util.Objects.requireNonNull;

/**
 * Basic implementation of a git hook callback.
 */
public abstract class AbstractGitHookHandler implements GitHookHandler {

    private final GitHook hook;

    protected AbstractGitHookHandler(@Nonnull GitHook hook) {
        this.hook = requireNonNull(hook, "hook");
    }

    @Override
    @Nonnull
    public String getHookName() {
        return hook.getName();
    }
}
