package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateSerializer;
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 com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 快照实体类
 *
 * @author hufy
 */
@Table("object_storage_container")
public class ObjectStorageContainer extends GenericEntity {
    @PK(value = PKStrategy.AUTO)
    private Long id;
    @Column("create_time")
    @JsonSerialize(
            using = DateSerializer.class
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date createTime;
    @Column("item_count")
    private Long itemCount; // 元素数量
    @Column("size")
    private Long size;  // 容器容量
    @Column("is_public")
    private Integer isPublic; // 是否公共的  0 私有 1 公共

    @Column("vendor_id")
    private Long vendorId;

    @IgnoreAll
    private Object vendorName;

    public Long getId() {

        return id;
    }

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

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getItemCount() {
        return itemCount;
    }

    public void setItemCount(Long itemCount) {
        this.itemCount = itemCount;
    }

    public Long getSize() {
        return size;
    }

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

    public Integer getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(Integer isPublic) {
        this.isPublic = isPublic;
    }

    public void setVendorId(Long vendorId) {
        this.vendorId = vendorId;
    }

    public Long getVendorId() {
        return vendorId;
    }

    public ObjectStorageContainer() {
        super();
    }


    public ObjectStorageContainer(Long id, String name, Date createTime, Long itemCount, Long size, Integer isPublic, Long vendorId) {
        this.id = id;
        this.setName(name);
        this.createTime = createTime;
        this.itemCount = itemCount;
        this.size = size;
        this.isPublic = isPublic;
        this.vendorId = vendorId;
    }

    public Object getVendorName() {
        return vendorName;
    }

    public void setVendorName(Object vendorName) {
        this.vendorName = vendorName;
    }
}
