package com.atlassian.bitbucket.mesh.git.mailmap;

import com.atlassian.bitbucket.mesh.rpc.v1.RpcPerson;
import com.atlassian.bitbucket.mesh.util.Person;

import javax.annotation.Nonnull;

/**
 * Applies the {@code .mailmap} to {@link RpcPerson person} entities. This is useful when low-level git commands are used
 * that don't automatically apply the .mailmap
 */
public interface MailmapResolver extends AutoCloseable {

    /**
     * Closes the resolver, terminating the {@code check-mailmap} process if it's running
     */
    @Override
    void close();

    /**
     * @param person the person to resolve
     * @return the resolved person
     */
    @Nonnull
    Person resolve(@Nonnull Person person);
}