package com.atlassian.bitbucket.internal.branch.model;

import com.google.common.base.MoreObjects;

import javax.annotation.Nonnull;

import static com.google.common.base.Preconditions.checkNotNull;

public class SimpleInternalBranchType extends SimpleBranchType implements InternalBranchType {

    private final String prefix;

    public SimpleInternalBranchType(@Nonnull BranchTypes type, @Nonnull String displayName, @Nonnull String prefix) {
        super(type, displayName);
        this.prefix = checkNotNull(prefix, "prefix");
    }

    @Nonnull
    @Override
    public String getPrefix() {
        return prefix;
    }

    @Override
    @Nonnull
    protected MoreObjects.ToStringHelper toStringHelper() {
        return super.toStringHelper().add("prefix", prefix);
    }
}
