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.ArrayList;
import java.util.List;
import java.util.Objects;

@Table("harbor_image")
public class HarborImage extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("project_id")
	private Long projectId;
	@Column("harbor_image_id")
	private Long harborImageId;
	@Column("harbor_id")
	private Long harborId;
	@Column("size")
	private Double size;
	@Column("creation_time")
	private String creationTime;
	@Column("update_time")
	private String updateTime;
	@Column("pull_count")
	private Integer pullCount;
	@Column("star_count")
	private Integer starCount;
	@Column("tags_count")
	private Integer tagsCount;
	@Column("description")
	private String description;
	@IgnoreAll
	private List<HarborTag> tagList = new ArrayList<>();

	@IgnoreAll
	private String harborName;

	public Long getId() {
		return id;
	}

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

	public Long getProjectId() {
		return projectId;
	}

	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	public Long getHarborImageId() {
		return harborImageId;
	}

	public void setHarborImageId(Long harborImageId) {
		this.harborImageId = harborImageId;
	}

	public Long getHarborId() {
		return harborId;
	}

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

	public Double getSize() {
		return size;
	}

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

	public String getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(String creationTime) {
		this.creationTime = creationTime;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getPullCount() {
		return pullCount;
	}

	public void setPullCount(Integer pullCount) {
		this.pullCount = pullCount;
	}

	public Integer getStarCount() {
		return starCount;
	}

	public void setStarCount(Integer starCount) {
		this.starCount = starCount;
	}

	public Integer getTagsCount() {
		return tagsCount;
	}

	public void setTagsCount(Integer tagsCount) {
		this.tagsCount = tagsCount;
	}

	public List<HarborTag> getTagList() {
		return tagList;
	}

	public void setTagList(List<HarborTag> tagList) {
		this.tagList = tagList;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		HarborImage that = (HarborImage) o;
		return Objects.equals(harborImageId, that.harborImageId) && Objects.equals(harborId, that.harborId);
	}

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

	public String getHarborName() {
		return harborName;
	}

	public void setHarborName(String harborName) {
		this.harborName = harborName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
}
