package com.yuchen.saas.integration.hik.isc.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.nest.springwrap.core.tool.node.INode;

import java.util.ArrayList;
import java.util.List;


@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CameraDeviceTreeVO", description = "CameraDeviceTreeVO")
public class CameraDeviceTreeVO extends CameraDeviceVO implements INode<CameraDeviceTreeVO> {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<CameraDeviceTreeVO> children;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private Boolean hasChildren;

	@Override
	public List<CameraDeviceTreeVO> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}

	private String parentName;


}
