/streamflow-core/streamflow-model/src/main/java/streamflow/model/ResourcePropertyOptions.java

https://github.com/lmco/streamflow · Java · 196 lines · 147 code · 34 blank · 15 comment · 54 complexity · d8062c7a822541a8b08bf6908adb2890 MD5 · raw file

  1. /**
  2. * Copyright 2014 Lockheed Martin Corporation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package streamflow.model;
  17. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  18. import com.fasterxml.jackson.annotation.JsonInclude;
  19. import com.fasterxml.jackson.annotation.JsonInclude.Include;
  20. import java.io.Serializable;
  21. import java.util.ArrayList;
  22. import org.mongodb.morphia.annotations.Embedded;
  23. @Embedded
  24. @JsonIgnoreProperties(ignoreUnknown = true)
  25. @JsonInclude(Include.NON_NULL)
  26. public class ResourcePropertyOptions implements Serializable {
  27. private Integer numericStep;
  28. private Integer maxNumber;
  29. private Integer minNumber;
  30. private Double floatStep;
  31. private String displayUnits;
  32. private String dateFormat;
  33. private Integer minuteStep;
  34. private Integer numRows;
  35. @Embedded
  36. private ArrayList<String> listItems = new ArrayList<String>();
  37. public ResourcePropertyOptions() {
  38. }
  39. public Integer getNumericStep() {
  40. return numericStep;
  41. }
  42. public void setNumericStep(Integer numericStep) {
  43. this.numericStep = numericStep;
  44. }
  45. public Integer getMaxNumber() {
  46. return maxNumber;
  47. }
  48. public void setMaxNumber(Integer maxNumber) {
  49. this.maxNumber = maxNumber;
  50. }
  51. public Integer getMinNumber() {
  52. return minNumber;
  53. }
  54. public void setMinNumber(Integer minNumber) {
  55. this.minNumber = minNumber;
  56. }
  57. public Double getFloatStep() {
  58. return floatStep;
  59. }
  60. public void setFloatStep(Double floatStep) {
  61. this.floatStep = floatStep;
  62. }
  63. public String getDisplayUnits() {
  64. return displayUnits;
  65. }
  66. public void setDisplayUnits(String displayUnits) {
  67. this.displayUnits = displayUnits;
  68. }
  69. public String getDateFormat() {
  70. return dateFormat;
  71. }
  72. public void setDateFormat(String dateFormat) {
  73. this.dateFormat = dateFormat;
  74. }
  75. public ArrayList<String> getListItems() {
  76. return listItems;
  77. }
  78. public void setListItems(ArrayList<String> listItems) {
  79. this.listItems = listItems;
  80. }
  81. public Integer getMinuteStep() {
  82. return minuteStep;
  83. }
  84. public void setMinuteStep(Integer minuteStep) {
  85. this.minuteStep = minuteStep;
  86. }
  87. public Integer getNumRows() {
  88. return numRows;
  89. }
  90. public void setNumRows(Integer numRows) {
  91. this.numRows = numRows;
  92. }
  93. @Override
  94. public int hashCode() {
  95. int hash = 5;
  96. hash = 59 * hash + (this.numericStep != null ? this.numericStep.hashCode() : 0);
  97. hash = 59 * hash + (this.maxNumber != null ? this.maxNumber.hashCode() : 0);
  98. hash = 59 * hash + (this.minNumber != null ? this.minNumber.hashCode() : 0);
  99. hash = 59 * hash + (this.floatStep != null ? this.floatStep.hashCode() : 0);
  100. hash = 59 * hash + (this.displayUnits != null ? this.displayUnits.hashCode() : 0);
  101. hash = 59 * hash + (this.dateFormat != null ? this.dateFormat.hashCode() : 0);
  102. hash = 59 * hash + (this.minuteStep != null ? this.minuteStep.hashCode() : 0);
  103. hash = 59 * hash + (this.numRows != null ? this.numRows.hashCode() : 0);
  104. hash = 59 * hash + (this.listItems != null ? this.listItems.hashCode() : 0);
  105. return hash;
  106. }
  107. @Override
  108. public boolean equals(Object obj) {
  109. if (obj == null) {
  110. return false;
  111. }
  112. if (getClass() != obj.getClass()) {
  113. return false;
  114. }
  115. final ResourcePropertyOptions other = (ResourcePropertyOptions) obj;
  116. if (this.numericStep != other.numericStep && (this.numericStep == null
  117. || !this.numericStep.equals(other.numericStep))) {
  118. return false;
  119. }
  120. if (this.maxNumber != other.maxNumber && (this.maxNumber == null
  121. || !this.maxNumber.equals(other.maxNumber))) {
  122. return false;
  123. }
  124. if (this.minNumber != other.minNumber && (this.minNumber == null
  125. || !this.minNumber.equals(other.minNumber))) {
  126. return false;
  127. }
  128. if (this.floatStep != other.floatStep && (this.floatStep == null
  129. || !this.floatStep.equals(other.floatStep))) {
  130. return false;
  131. }
  132. if ((this.displayUnits == null) ? (other.displayUnits != null)
  133. : !this.displayUnits.equals(other.displayUnits)) {
  134. return false;
  135. }
  136. if ((this.dateFormat == null) ? (other.dateFormat != null)
  137. : !this.dateFormat.equals(other.dateFormat)) {
  138. return false;
  139. }
  140. if (this.minuteStep != other.minuteStep && (this.minuteStep == null
  141. || !this.minuteStep.equals(other.minuteStep))) {
  142. return false;
  143. }
  144. if (this.numRows != other.numRows && (this.numRows == null
  145. || !this.numRows.equals(other.numRows))) {
  146. return false;
  147. }
  148. if (this.listItems != other.listItems && (this.listItems == null
  149. || !this.listItems.equals(other.listItems))) {
  150. return false;
  151. }
  152. return true;
  153. }
  154. @Override
  155. public String toString() {
  156. return "ResourcePropertyOptions{" + "numericStep=" + numericStep
  157. + ", maxNumber=" + maxNumber + ", minNumber=" + minNumber
  158. + ", floatStep=" + floatStep + ", displayUnits=" + displayUnits
  159. + ", dateFormat=" + dateFormat + ", minuteStep=" + minuteStep
  160. + ", numRows=" + numRows + ", listItems=" + listItems + '}';
  161. }
  162. }