/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/org/openapitools/model/FormatTest.java

https://github.com/OpenAPITools/openapi-generator · Java · 373 lines · 259 code · 85 blank · 29 comment · 8 complexity · fb56618c1b64f1bcc0cfff0d1a867416 MD5 · raw file

  1. package org.openapitools.model;
  2. import io.swagger.annotations.ApiModel;
  3. import io.swagger.annotations.ApiModelProperty;
  4. import java.io.File;
  5. import java.math.BigDecimal;
  6. import java.util.Date;
  7. import java.util.UUID;
  8. import org.joda.time.LocalDate;
  9. import java.io.Serializable;
  10. import javax.validation.constraints.*;
  11. import javax.validation.Valid;
  12. import io.swagger.annotations.*;
  13. import java.util.Objects;
  14. import com.fasterxml.jackson.annotation.JsonProperty;
  15. import com.fasterxml.jackson.annotation.JsonCreator;
  16. import com.fasterxml.jackson.annotation.JsonValue;
  17. @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen")public class FormatTest implements Serializable {
  18. private @Valid Integer integer;
  19. private @Valid Integer int32;
  20. private @Valid Long int64;
  21. private @Valid BigDecimal number;
  22. private @Valid Float _float;
  23. private @Valid Double _double;
  24. private @Valid String string;
  25. private @Valid byte[] _byte;
  26. private @Valid File binary;
  27. private @Valid LocalDate date;
  28. private @Valid Date dateTime;
  29. private @Valid UUID uuid;
  30. private @Valid String password;
  31. private @Valid BigDecimal bigDecimal;
  32. /**
  33. * minimum: 10
  34. * maximum: 100
  35. **/
  36. public FormatTest integer(Integer integer) {
  37. this.integer = integer;
  38. return this;
  39. }
  40. @ApiModelProperty(value = "")
  41. @JsonProperty("integer")
  42. @Min(10) @Max(100) public Integer getInteger() {
  43. return integer;
  44. }
  45. public void setInteger(Integer integer) {
  46. this.integer = integer;
  47. }/**
  48. * minimum: 20
  49. * maximum: 200
  50. **/
  51. public FormatTest int32(Integer int32) {
  52. this.int32 = int32;
  53. return this;
  54. }
  55. @ApiModelProperty(value = "")
  56. @JsonProperty("int32")
  57. @Min(20) @Max(200) public Integer getInt32() {
  58. return int32;
  59. }
  60. public void setInt32(Integer int32) {
  61. this.int32 = int32;
  62. }/**
  63. **/
  64. public FormatTest int64(Long int64) {
  65. this.int64 = int64;
  66. return this;
  67. }
  68. @ApiModelProperty(value = "")
  69. @JsonProperty("int64")
  70. public Long getInt64() {
  71. return int64;
  72. }
  73. public void setInt64(Long int64) {
  74. this.int64 = int64;
  75. }/**
  76. * minimum: 32.1
  77. * maximum: 543.2
  78. **/
  79. public FormatTest number(BigDecimal number) {
  80. this.number = number;
  81. return this;
  82. }
  83. @ApiModelProperty(required = true, value = "")
  84. @JsonProperty("number")
  85. @NotNull
  86. @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
  87. return number;
  88. }
  89. public void setNumber(BigDecimal number) {
  90. this.number = number;
  91. }/**
  92. * minimum: 54.3
  93. * maximum: 987.6
  94. **/
  95. public FormatTest _float(Float _float) {
  96. this._float = _float;
  97. return this;
  98. }
  99. @ApiModelProperty(value = "")
  100. @JsonProperty("float")
  101. @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
  102. return _float;
  103. }
  104. public void setFloat(Float _float) {
  105. this._float = _float;
  106. }/**
  107. * minimum: 67.8
  108. * maximum: 123.4
  109. **/
  110. public FormatTest _double(Double _double) {
  111. this._double = _double;
  112. return this;
  113. }
  114. @ApiModelProperty(value = "")
  115. @JsonProperty("double")
  116. @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
  117. return _double;
  118. }
  119. public void setDouble(Double _double) {
  120. this._double = _double;
  121. }/**
  122. **/
  123. public FormatTest string(String string) {
  124. this.string = string;
  125. return this;
  126. }
  127. @ApiModelProperty(value = "")
  128. @JsonProperty("string")
  129. @Pattern(regexp="/[a-z]/i") public String getString() {
  130. return string;
  131. }
  132. public void setString(String string) {
  133. this.string = string;
  134. }/**
  135. **/
  136. public FormatTest _byte(byte[] _byte) {
  137. this._byte = _byte;
  138. return this;
  139. }
  140. @ApiModelProperty(required = true, value = "")
  141. @JsonProperty("byte")
  142. @NotNull
  143. @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") public byte[] getByte() {
  144. return _byte;
  145. }
  146. public void setByte(byte[] _byte) {
  147. this._byte = _byte;
  148. }/**
  149. **/
  150. public FormatTest binary(File binary) {
  151. this.binary = binary;
  152. return this;
  153. }
  154. @ApiModelProperty(value = "")
  155. @JsonProperty("binary")
  156. public File getBinary() {
  157. return binary;
  158. }
  159. public void setBinary(File binary) {
  160. this.binary = binary;
  161. }/**
  162. **/
  163. public FormatTest date(LocalDate date) {
  164. this.date = date;
  165. return this;
  166. }
  167. @ApiModelProperty(required = true, value = "")
  168. @JsonProperty("date")
  169. @NotNull
  170. public LocalDate getDate() {
  171. return date;
  172. }
  173. public void setDate(LocalDate date) {
  174. this.date = date;
  175. }/**
  176. **/
  177. public FormatTest dateTime(Date dateTime) {
  178. this.dateTime = dateTime;
  179. return this;
  180. }
  181. @ApiModelProperty(value = "")
  182. @JsonProperty("dateTime")
  183. public Date getDateTime() {
  184. return dateTime;
  185. }
  186. public void setDateTime(Date dateTime) {
  187. this.dateTime = dateTime;
  188. }/**
  189. **/
  190. public FormatTest uuid(UUID uuid) {
  191. this.uuid = uuid;
  192. return this;
  193. }
  194. @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
  195. @JsonProperty("uuid")
  196. public UUID getUuid() {
  197. return uuid;
  198. }
  199. public void setUuid(UUID uuid) {
  200. this.uuid = uuid;
  201. }/**
  202. **/
  203. public FormatTest password(String password) {
  204. this.password = password;
  205. return this;
  206. }
  207. @ApiModelProperty(required = true, value = "")
  208. @JsonProperty("password")
  209. @NotNull
  210. @Size(min=10,max=64) public String getPassword() {
  211. return password;
  212. }
  213. public void setPassword(String password) {
  214. this.password = password;
  215. }/**
  216. **/
  217. public FormatTest bigDecimal(BigDecimal bigDecimal) {
  218. this.bigDecimal = bigDecimal;
  219. return this;
  220. }
  221. @ApiModelProperty(value = "")
  222. @JsonProperty("BigDecimal")
  223. public BigDecimal getBigDecimal() {
  224. return bigDecimal;
  225. }
  226. public void setBigDecimal(BigDecimal bigDecimal) {
  227. this.bigDecimal = bigDecimal;
  228. }
  229. @Override
  230. public boolean equals(Object o) {
  231. if (this == o) {
  232. return true;
  233. }
  234. if (o == null || getClass() != o.getClass()) {
  235. return false;
  236. }
  237. FormatTest formatTest = (FormatTest) o;
  238. return Objects.equals(this.integer, formatTest.integer) &&
  239. Objects.equals(this.int32, formatTest.int32) &&
  240. Objects.equals(this.int64, formatTest.int64) &&
  241. Objects.equals(this.number, formatTest.number) &&
  242. Objects.equals(this._float, formatTest._float) &&
  243. Objects.equals(this._double, formatTest._double) &&
  244. Objects.equals(this.string, formatTest.string) &&
  245. Objects.equals(this._byte, formatTest._byte) &&
  246. Objects.equals(this.binary, formatTest.binary) &&
  247. Objects.equals(this.date, formatTest.date) &&
  248. Objects.equals(this.dateTime, formatTest.dateTime) &&
  249. Objects.equals(this.uuid, formatTest.uuid) &&
  250. Objects.equals(this.password, formatTest.password) &&
  251. Objects.equals(this.bigDecimal, formatTest.bigDecimal);
  252. }
  253. @Override
  254. public int hashCode() {
  255. return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, bigDecimal);
  256. }
  257. @Override
  258. public String toString() {
  259. StringBuilder sb = new StringBuilder();
  260. sb.append("class FormatTest {\n");
  261. sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
  262. sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
  263. sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
  264. sb.append(" number: ").append(toIndentedString(number)).append("\n");
  265. sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
  266. sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
  267. sb.append(" string: ").append(toIndentedString(string)).append("\n");
  268. sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
  269. sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
  270. sb.append(" date: ").append(toIndentedString(date)).append("\n");
  271. sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
  272. sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
  273. sb.append(" password: ").append(toIndentedString(password)).append("\n");
  274. sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n");
  275. sb.append("}");
  276. return sb.toString();
  277. }
  278. /**
  279. * Convert the given object to string with each line indented by 4 spaces
  280. * (except the first line).
  281. */
  282. private String toIndentedString(Object o) {
  283. if (o == null) {
  284. return "null";
  285. }
  286. return o.toString().replace("\n", "\n ");
  287. }
  288. }