|
| 1 | +/* |
| 2 | + * Sessionize JSON-REST API |
| 3 | + * Sessionize JSON-REST API documentation by XDEV Software |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 2.0 |
| 6 | + * |
| 7 | + * |
| 8 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 9 | + * https://openapi-generator.tech |
| 10 | + * Do not edit the class manually. |
| 11 | + */ |
| 12 | + |
| 13 | + |
| 14 | +package software.xdev.sessionize.model; |
| 15 | + |
| 16 | +import java.util.Objects; |
| 17 | +import java.util.Arrays; |
| 18 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 19 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 20 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 21 | +import com.fasterxml.jackson.annotation.JsonTypeName; |
| 22 | +import com.fasterxml.jackson.annotation.JsonValue; |
| 23 | +import java.util.UUID; |
| 24 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 25 | +import com.fasterxml.jackson.annotation.JsonTypeName; |
| 26 | +import java.io.UnsupportedEncodingException; |
| 27 | +import java.net.URLEncoder; |
| 28 | +import java.util.StringJoiner; |
| 29 | + |
| 30 | +/** |
| 31 | + * BaseSpeakerEssential |
| 32 | + */ |
| 33 | +@JsonPropertyOrder({ |
| 34 | + BaseSpeakerEssential.JSON_PROPERTY_ID, |
| 35 | + BaseSpeakerEssential.JSON_PROPERTY_FIRST_NAME, |
| 36 | + BaseSpeakerEssential.JSON_PROPERTY_LAST_NAME |
| 37 | +}) |
| 38 | +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") |
| 39 | +public class BaseSpeakerEssential { |
| 40 | + public static final String JSON_PROPERTY_ID = "id"; |
| 41 | + private UUID id; |
| 42 | + |
| 43 | + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; |
| 44 | + private String firstName; |
| 45 | + |
| 46 | + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; |
| 47 | + private String lastName; |
| 48 | + |
| 49 | + public BaseSpeakerEssential() { |
| 50 | + } |
| 51 | + |
| 52 | + public BaseSpeakerEssential id(UUID id) { |
| 53 | + |
| 54 | + this.id = id; |
| 55 | + return this; |
| 56 | + } |
| 57 | + |
| 58 | + /** |
| 59 | + * Get id |
| 60 | + * @return id |
| 61 | + **/ |
| 62 | + @jakarta.annotation.Nonnull |
| 63 | + @JsonProperty(JSON_PROPERTY_ID) |
| 64 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 65 | + |
| 66 | + public UUID getId() { |
| 67 | + return id; |
| 68 | + } |
| 69 | + |
| 70 | + |
| 71 | + @JsonProperty(JSON_PROPERTY_ID) |
| 72 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 73 | + public void setId(UUID id) { |
| 74 | + this.id = id; |
| 75 | + } |
| 76 | + |
| 77 | + |
| 78 | + public BaseSpeakerEssential firstName(String firstName) { |
| 79 | + |
| 80 | + this.firstName = firstName; |
| 81 | + return this; |
| 82 | + } |
| 83 | + |
| 84 | + /** |
| 85 | + * Get firstName |
| 86 | + * @return firstName |
| 87 | + **/ |
| 88 | + @jakarta.annotation.Nonnull |
| 89 | + @JsonProperty(JSON_PROPERTY_FIRST_NAME) |
| 90 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 91 | + |
| 92 | + public String getFirstName() { |
| 93 | + return firstName; |
| 94 | + } |
| 95 | + |
| 96 | + |
| 97 | + @JsonProperty(JSON_PROPERTY_FIRST_NAME) |
| 98 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 99 | + public void setFirstName(String firstName) { |
| 100 | + this.firstName = firstName; |
| 101 | + } |
| 102 | + |
| 103 | + |
| 104 | + public BaseSpeakerEssential lastName(String lastName) { |
| 105 | + |
| 106 | + this.lastName = lastName; |
| 107 | + return this; |
| 108 | + } |
| 109 | + |
| 110 | + /** |
| 111 | + * Get lastName |
| 112 | + * @return lastName |
| 113 | + **/ |
| 114 | + @jakarta.annotation.Nonnull |
| 115 | + @JsonProperty(JSON_PROPERTY_LAST_NAME) |
| 116 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 117 | + |
| 118 | + public String getLastName() { |
| 119 | + return lastName; |
| 120 | + } |
| 121 | + |
| 122 | + |
| 123 | + @JsonProperty(JSON_PROPERTY_LAST_NAME) |
| 124 | + @JsonInclude(value = JsonInclude.Include.ALWAYS) |
| 125 | + public void setLastName(String lastName) { |
| 126 | + this.lastName = lastName; |
| 127 | + } |
| 128 | + |
| 129 | + @Override |
| 130 | + public boolean equals(Object o) { |
| 131 | + if (this == o) { |
| 132 | + return true; |
| 133 | + } |
| 134 | + if (o == null || getClass() != o.getClass()) { |
| 135 | + return false; |
| 136 | + } |
| 137 | + BaseSpeakerEssential baseSpeakerEssential = (BaseSpeakerEssential) o; |
| 138 | + return Objects.equals(this.id, baseSpeakerEssential.id) && |
| 139 | + Objects.equals(this.firstName, baseSpeakerEssential.firstName) && |
| 140 | + Objects.equals(this.lastName, baseSpeakerEssential.lastName); |
| 141 | + } |
| 142 | + |
| 143 | + @Override |
| 144 | + public int hashCode() { |
| 145 | + return Objects.hash(id, firstName, lastName); |
| 146 | + } |
| 147 | + |
| 148 | + @Override |
| 149 | + public String toString() { |
| 150 | + StringBuilder sb = new StringBuilder(); |
| 151 | + sb.append("class BaseSpeakerEssential {\n"); |
| 152 | + sb.append(" id: ").append(toIndentedString(id)).append("\n"); |
| 153 | + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); |
| 154 | + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); |
| 155 | + sb.append("}"); |
| 156 | + return sb.toString(); |
| 157 | + } |
| 158 | + |
| 159 | + /** |
| 160 | + * Convert the given object to string with each line indented by 4 spaces |
| 161 | + * (except the first line). |
| 162 | + */ |
| 163 | + private String toIndentedString(Object o) { |
| 164 | + if (o == null) { |
| 165 | + return "null"; |
| 166 | + } |
| 167 | + return o.toString().replace("\n", "\n "); |
| 168 | + } |
| 169 | + |
| 170 | + /** |
| 171 | + * Convert the instance into URL query string. |
| 172 | + * |
| 173 | + * @return URL query string |
| 174 | + */ |
| 175 | + public String toUrlQueryString() { |
| 176 | + return toUrlQueryString(null); |
| 177 | + } |
| 178 | + |
| 179 | + /** |
| 180 | + * Convert the instance into URL query string. |
| 181 | + * |
| 182 | + * @param prefix prefix of the query string |
| 183 | + * @return URL query string |
| 184 | + */ |
| 185 | + public String toUrlQueryString(String prefix) { |
| 186 | + String suffix = ""; |
| 187 | + String containerSuffix = ""; |
| 188 | + String containerPrefix = ""; |
| 189 | + if (prefix == null) { |
| 190 | + // style=form, explode=true, e.g. /pet?name=cat&type=manx |
| 191 | + prefix = ""; |
| 192 | + } else { |
| 193 | + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx |
| 194 | + prefix = prefix + "["; |
| 195 | + suffix = "]"; |
| 196 | + containerSuffix = "]"; |
| 197 | + containerPrefix = "["; |
| 198 | + } |
| 199 | + |
| 200 | + StringJoiner joiner = new StringJoiner("&"); |
| 201 | + |
| 202 | + // add `id` to the URL query string |
| 203 | + if (getId() != null) { |
| 204 | + try { |
| 205 | + joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20"))); |
| 206 | + } catch (UnsupportedEncodingException e) { |
| 207 | + // Should never happen, UTF-8 is always supported |
| 208 | + throw new RuntimeException(e); |
| 209 | + } |
| 210 | + } |
| 211 | + |
| 212 | + // add `firstName` to the URL query string |
| 213 | + if (getFirstName() != null) { |
| 214 | + try { |
| 215 | + joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20"))); |
| 216 | + } catch (UnsupportedEncodingException e) { |
| 217 | + // Should never happen, UTF-8 is always supported |
| 218 | + throw new RuntimeException(e); |
| 219 | + } |
| 220 | + } |
| 221 | + |
| 222 | + // add `lastName` to the URL query string |
| 223 | + if (getLastName() != null) { |
| 224 | + try { |
| 225 | + joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20"))); |
| 226 | + } catch (UnsupportedEncodingException e) { |
| 227 | + // Should never happen, UTF-8 is always supported |
| 228 | + throw new RuntimeException(e); |
| 229 | + } |
| 230 | + } |
| 231 | + |
| 232 | + return joiner.toString(); |
| 233 | + } |
| 234 | + |
| 235 | +} |
| 236 | + |
0 commit comments