DeviceChannelTree.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. package com.genersoft.iot.vmp.vmanager.bean;
  2. import com.fasterxml.jackson.annotation.JsonInclude;
  3. import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
  4. import com.genersoft.iot.vmp.utils.node.INode;
  5. import io.swagger.annotations.ApiModel;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. @ApiModel(value = "DeviceChannelTree对象", description = "DeviceChannelTree对象")
  9. public class DeviceChannelTree extends DeviceChannel implements INode<DeviceChannelTree> {
  10. private static final long serialVersionUID = 1L;
  11. /**
  12. * 主键ID
  13. */
  14. private int id;
  15. /**
  16. * 父节点ID
  17. */
  18. private String parentId;
  19. private String parentName;
  20. private String title;
  21. private String key;
  22. private String value;
  23. /**
  24. * 子孙节点
  25. */
  26. @JsonInclude(JsonInclude.Include.NON_EMPTY)
  27. private List<DeviceChannelTree> children;
  28. /**
  29. * 是否有子孙节点
  30. */
  31. @JsonInclude(JsonInclude.Include.NON_EMPTY)
  32. private Boolean hasChildren;
  33. @Override
  34. public List<DeviceChannelTree> getChildren() {
  35. if (this.children == null) {
  36. this.children = new ArrayList<>();
  37. }
  38. return this.children;
  39. }
  40. @Override
  41. public Boolean getHasChildren() {
  42. if (children.size() > 0) {
  43. return true;
  44. } else {
  45. return this.hasChildren;
  46. }
  47. }
  48. @Override
  49. public int getId() {
  50. return id;
  51. }
  52. @Override
  53. public void setId(int id) {
  54. this.id = id;
  55. }
  56. @Override
  57. public String getParentId() {
  58. return parentId;
  59. }
  60. @Override
  61. public void setParentId(String parentId) {
  62. this.parentId = parentId;
  63. }
  64. public String getParentName() {
  65. return parentName;
  66. }
  67. public void setParentName(String parentName) {
  68. this.parentName = parentName;
  69. }
  70. public String getTitle() {
  71. return title;
  72. }
  73. public void setTitle(String title) {
  74. this.title = title;
  75. }
  76. public String getKey() {
  77. return key;
  78. }
  79. public void setKey(String key) {
  80. this.key = key;
  81. }
  82. public String getValue() {
  83. return value;
  84. }
  85. public void setValue(String value) {
  86. this.value = value;
  87. }
  88. public void setChildren(List<DeviceChannelTree> children) {
  89. this.children = children;
  90. }
  91. public void setHasChildren(Boolean hasChildren) {
  92. this.hasChildren = hasChildren;
  93. }
  94. }