package com.atlassian.bitbucket.mesh.repository;

import javax.annotation.Nonnull;

public interface RepositoryVisitor<T> {

    default T defaultValue(Repository repository) {
        return null;
    }

    default T visit(@Nonnull BitbucketServerRepository repository) {
        return defaultValue(repository);
    }

    default T visit(@Nonnull ManagedRepository repository) {
        return defaultValue(repository);
    }

    default T visit(@Nonnull PathRepository repository) {
        return defaultValue(repository);
    }

    default T visit(@Nonnull SharedObjectsRepository repository) {
        return defaultValue(repository);
    }

    default T visit(@Nonnull WorkTree workTree) {
        return defaultValue(workTree);
    }
}
