package fr.emse.gitlab.saref.entities.git;

import java.util.Date;

import org.eclipse.jgit.lib.Ref;

public class ReleaseVersion extends Version {

	private final int major;
	private final int minor;
	private final int patch;

	ReleaseVersion(Repository repository, Ref ref, Date issued, int major, int minor, int patch) {
		super(repository, ref, issued);
		this.major = major;
		this.minor = minor;
		this.patch = patch;
	}

	public int getMajor() {
		return major;
	}

	public int getMinor() {
		return minor;
	}

	public int getPatch() {
		return patch;
	}

	@Override
	public String getPrefix() {
		return String.format("%s-%s.%s.%s:", super.getSuperPrefix(), major, minor, patch);
	}

	@Override
	public String getUri() {
		return String.format("%sv%s.%s.%s/", super.getSuperUri(), major, minor, patch);
	}
	
	@Override
	public String getVersionName() {
		return String.format("v%s.%s.%s", major, minor, patch);
	}

}
