package com.atlassian.bitbucket.internal.importer.github;

import static java.util.Objects.requireNonNull;

/**
 * Builds a url to get the currently authenticated user
 */
public class UserUrlBuilder extends AbstractUrlBuilder<UserUrlBuilder> {

    private final String username;

    protected UserUrlBuilder(String username, String defaultBaseUrl) {
        super(defaultBaseUrl);
        this.username = requireNonNull(username, "username");
    }

    public String build() {
        return base() + "/users/" + username;
    }

    @Override
    public UserUrlBuilder self() {
        return this;
    }
}