package com.bocloud.ims.entity.resource;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;

import java.util.Objects;

@Table("harbor_tag")
public class HarborTag extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("image_id")
	private Long imageId;
	@Column("harbor_id")
	private Long harborId;
	@Column("digest")
	private String digest;
	@Column("size")
	private String size;
	@Column("architecture")
	private String architecture;
	@Column("os")
	private String os;
	@Column("os_version")
	private String osVersion;
	@Column("docker_version")
	private String dockerVersion;
	@Column("author")
	private String author;
	@Column("created")
	private String created;
	@Column("config")
	private String config;
	@Column("immutable")
	private String immutable;
	@Column("signature")
	private String signature;
	@Column("labels")
	private String labels;
	@Column("push_time")
	private String pushTime;
	@Column("pull_time")
	private String pullTime;
	@IgnoreAll
	private String imageName;// 镜像名字

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getImageId() {
		return imageId;
	}

	public void setImageId(Long imageId) {
		this.imageId = imageId;
	}

	public Long getHarborId() {
		return harborId;
	}

	public void setHarborId(Long harborId) {
		this.harborId = harborId;
	}

	public String getDigest() {
		return digest;
	}

	public void setDigest(String digest) {
		this.digest = digest;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getArchitecture() {
		return architecture;
	}

	public void setArchitecture(String architecture) {
		this.architecture = architecture;
	}

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public String getOsVersion() {
		return osVersion;
	}

	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	public String getDockerVersion() {
		return dockerVersion;
	}

	public void setDockerVersion(String dockerVersion) {
		this.dockerVersion = dockerVersion;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getCreated() {
		return created;
	}

	public void setCreated(String created) {
		this.created = created;
	}

	public String getConfig() {
		return config;
	}

	public void setConfig(String config) {
		this.config = config;
	}

	public String getImmutable() {
		return immutable;
	}

	public void setImmutable(String immutable) {
		this.immutable = immutable;
	}

	public String getSignature() {
		return signature;
	}

	public void setSignature(String signature) {
		this.signature = signature;
	}

	public String getLabels() {
		return labels;
	}

	public void setLabels(String labels) {
		this.labels = labels;
	}

	public String getPushTime() {
		return pushTime;
	}

	public void setPushTime(String pushTime) {
		this.pushTime = pushTime;
	}

	public String getPullTime() {
		return pullTime;
	}

	public void setPullTime(String pullTime) {
		this.pullTime = pullTime;
	}

	public String getImageName() {
		return imageName;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		HarborTag harborTag = (HarborTag) o;
		return Objects.equals(harborId, harborTag.harborId) && Objects.equals(imageName, harborTag.imageName)
				&& Objects.equals(getName(), harborTag.getName());
	}

	@Override
	public int hashCode() {
		return Objects.hash(this.getName(), harborId, imageName);
	}
}
