package com.atlassian.bitbucket.internal.mirroring.mirror;

import com.atlassian.bitbucket.mirroring.mirror.UpstreamServer;

import javax.annotation.Nonnull;

public class MirrorDescriptionUtils {
    private MirrorDescriptionUtils() {
    }

    public static String describe(@Nonnull UpstreamServer upstream) {
        return "UpstreamServer[" + upstream.getBaseUrl() + "]#" + upstream.getNamespace();
    }

    public static String describe(@Nonnull ExternalProject project) {
        return "ExternalProject[" + project.getKey() + "]#" + project.getId();
    }

    public static String describe(@Nonnull MinimalExternalRepository repository) {
        return "ExternalRepository[" + (repository.getProject() == null ? "???" : repository.getProject().getKey())
                + "/" + repository.getSlug() + "]#" + repository.getId();
    }
}