package com.atlassian.bitbucket.repository.ref.restriction;

import javax.annotation.Nonnull;

/**
 * A base implementation of {@link AccessGrantVisitor} that returns {@code null} for all access grant types
 */
public class AbstractAccessGrantVisitor<T> implements AccessGrantVisitor<T> {

    @Override
    public T visit(@Nonnull GroupAccessGrant grant) {
        return defaultValue();
    }

    @Override
    public T visit(@Nonnull UserAccessGrant grant) {
        return defaultValue();
    }

    protected T defaultValue() {
        return null;
    }
}
