software.xdev.sessionize.model.SpeakerAll Maven / Gradle / Ivy
/*
* Sessionize JSON-REST API
* Sessionize JSON-REST API documentation by XDEV Software
*
* The version of the OpenAPI document: 2.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package software.xdev.sessionize.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.openapitools.jackson.nullable.JsonNullable;
import software.xdev.sessionize.model.Link;
import software.xdev.sessionize.model.QuestionAnswer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* SpeakerAll
*/
@JsonPropertyOrder({
SpeakerAll.JSON_PROPERTY_ID,
SpeakerAll.JSON_PROPERTY_FIRST_NAME,
SpeakerAll.JSON_PROPERTY_LAST_NAME,
SpeakerAll.JSON_PROPERTY_BIO,
SpeakerAll.JSON_PROPERTY_TAG_LINE,
SpeakerAll.JSON_PROPERTY_PROFILE_PICTURE,
SpeakerAll.JSON_PROPERTY_IS_TOP_SPEAKER,
SpeakerAll.JSON_PROPERTY_LINKS,
SpeakerAll.JSON_PROPERTY_FULL_NAME,
SpeakerAll.JSON_PROPERTY_SESSIONS,
SpeakerAll.JSON_PROPERTY_QUESTION_ANSWERS
})
public class SpeakerAll {
public static final String JSON_PROPERTY_ID = "id";
private UUID id;
public static final String JSON_PROPERTY_FIRST_NAME = "firstName";
private String firstName;
public static final String JSON_PROPERTY_LAST_NAME = "lastName";
private String lastName;
public static final String JSON_PROPERTY_BIO = "bio";
private JsonNullable bio = JsonNullable.undefined();
public static final String JSON_PROPERTY_TAG_LINE = "tagLine";
private String tagLine;
public static final String JSON_PROPERTY_PROFILE_PICTURE = "profilePicture";
private JsonNullable profilePicture = JsonNullable.undefined();
public static final String JSON_PROPERTY_IS_TOP_SPEAKER = "isTopSpeaker";
private Boolean isTopSpeaker;
public static final String JSON_PROPERTY_LINKS = "links";
private List links = new ArrayList<>();
public static final String JSON_PROPERTY_FULL_NAME = "fullName";
private String fullName;
public static final String JSON_PROPERTY_SESSIONS = "sessions";
private List sessions = new ArrayList<>();
public static final String JSON_PROPERTY_QUESTION_ANSWERS = "questionAnswers";
private List questionAnswers = new ArrayList<>();
public SpeakerAll() {
}
public SpeakerAll id(UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public UUID getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setId(UUID id) {
this.id = id;
}
public SpeakerAll firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_FIRST_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getFirstName() {
return firstName;
}
@JsonProperty(JSON_PROPERTY_FIRST_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public SpeakerAll lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_LAST_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getLastName() {
return lastName;
}
@JsonProperty(JSON_PROPERTY_LAST_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setLastName(String lastName) {
this.lastName = lastName;
}
public SpeakerAll bio(String bio) {
this.bio = JsonNullable.of(bio);
return this;
}
/**
* Get bio
* @return bio
**/
@jakarta.annotation.Nullable
@JsonIgnore
public String getBio() {
return bio.orElse(null);
}
@JsonProperty(JSON_PROPERTY_BIO)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getBio_JsonNullable() {
return bio;
}
@JsonProperty(JSON_PROPERTY_BIO)
public void setBio_JsonNullable(JsonNullable bio) {
this.bio = bio;
}
public void setBio(String bio) {
this.bio = JsonNullable.of(bio);
}
public SpeakerAll tagLine(String tagLine) {
this.tagLine = tagLine;
return this;
}
/**
* Get tagLine
* @return tagLine
**/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TAG_LINE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getTagLine() {
return tagLine;
}
@JsonProperty(JSON_PROPERTY_TAG_LINE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setTagLine(String tagLine) {
this.tagLine = tagLine;
}
public SpeakerAll profilePicture(URI profilePicture) {
this.profilePicture = JsonNullable.of(profilePicture);
return this;
}
/**
* Get profilePicture
* @return profilePicture
**/
@jakarta.annotation.Nullable
@JsonIgnore
public URI getProfilePicture() {
return profilePicture.orElse(null);
}
@JsonProperty(JSON_PROPERTY_PROFILE_PICTURE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getProfilePicture_JsonNullable() {
return profilePicture;
}
@JsonProperty(JSON_PROPERTY_PROFILE_PICTURE)
public void setProfilePicture_JsonNullable(JsonNullable profilePicture) {
this.profilePicture = profilePicture;
}
public void setProfilePicture(URI profilePicture) {
this.profilePicture = JsonNullable.of(profilePicture);
}
public SpeakerAll isTopSpeaker(Boolean isTopSpeaker) {
this.isTopSpeaker = isTopSpeaker;
return this;
}
/**
* Get isTopSpeaker
* @return isTopSpeaker
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Boolean getIsTopSpeaker() {
return isTopSpeaker;
}
@JsonProperty(JSON_PROPERTY_IS_TOP_SPEAKER)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setIsTopSpeaker(Boolean isTopSpeaker) {
this.isTopSpeaker = isTopSpeaker;
}
public SpeakerAll links(List links) {
this.links = links;
return this;
}
public SpeakerAll addLinksItem(Link linksItem) {
if (this.links == null) {
this.links = new ArrayList<>();
}
this.links.add(linksItem);
return this;
}
/**
* Get links
* @return links
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_LINKS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getLinks() {
return links;
}
@JsonProperty(JSON_PROPERTY_LINKS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setLinks(List links) {
this.links = links;
}
public SpeakerAll fullName(String fullName) {
this.fullName = fullName;
return this;
}
/**
* Get fullName
* @return fullName
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_FULL_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getFullName() {
return fullName;
}
@JsonProperty(JSON_PROPERTY_FULL_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setFullName(String fullName) {
this.fullName = fullName;
}
public SpeakerAll sessions(List sessions) {
this.sessions = sessions;
return this;
}
public SpeakerAll addSessionsItem(Integer sessionsItem) {
if (this.sessions == null) {
this.sessions = new ArrayList<>();
}
this.sessions.add(sessionsItem);
return this;
}
/**
* Get sessions
* @return sessions
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_SESSIONS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getSessions() {
return sessions;
}
@JsonProperty(JSON_PROPERTY_SESSIONS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setSessions(List sessions) {
this.sessions = sessions;
}
public SpeakerAll questionAnswers(List questionAnswers) {
this.questionAnswers = questionAnswers;
return this;
}
public SpeakerAll addQuestionAnswersItem(QuestionAnswer questionAnswersItem) {
if (this.questionAnswers == null) {
this.questionAnswers = new ArrayList<>();
}
this.questionAnswers.add(questionAnswersItem);
return this;
}
/**
* Get questionAnswers
* @return questionAnswers
**/
@jakarta.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getQuestionAnswers() {
return questionAnswers;
}
@JsonProperty(JSON_PROPERTY_QUESTION_ANSWERS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setQuestionAnswers(List questionAnswers) {
this.questionAnswers = questionAnswers;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpeakerAll speakerAll = (SpeakerAll) o;
return Objects.equals(this.id, speakerAll.id) &&
Objects.equals(this.firstName, speakerAll.firstName) &&
Objects.equals(this.lastName, speakerAll.lastName) &&
equalsNullable(this.bio, speakerAll.bio) &&
Objects.equals(this.tagLine, speakerAll.tagLine) &&
equalsNullable(this.profilePicture, speakerAll.profilePicture) &&
Objects.equals(this.isTopSpeaker, speakerAll.isTopSpeaker) &&
Objects.equals(this.links, speakerAll.links) &&
Objects.equals(this.fullName, speakerAll.fullName) &&
Objects.equals(this.sessions, speakerAll.sessions) &&
Objects.equals(this.questionAnswers, speakerAll.questionAnswers);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, firstName, lastName, hashCodeNullable(bio), tagLine, hashCodeNullable(profilePicture), isTopSpeaker, links, fullName, sessions, questionAnswers);
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SpeakerAll {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" bio: ").append(toIndentedString(bio)).append("\n");
sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n");
sb.append(" profilePicture: ").append(toIndentedString(profilePicture)).append("\n");
sb.append(" isTopSpeaker: ").append(toIndentedString(isTopSpeaker)).append("\n");
sb.append(" links: ").append(toIndentedString(links)).append("\n");
sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n");
sb.append(" sessions: ").append(toIndentedString(sessions)).append("\n");
sb.append(" questionAnswers: ").append(toIndentedString(questionAnswers)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `id` to the URL query string
if (getId() != null) {
try {
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `firstName` to the URL query string
if (getFirstName() != null) {
try {
joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `lastName` to the URL query string
if (getLastName() != null) {
try {
joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `bio` to the URL query string
if (getBio() != null) {
try {
joiner.add(String.format("%sbio%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBio()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `tagLine` to the URL query string
if (getTagLine() != null) {
try {
joiner.add(String.format("%stagLine%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTagLine()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `profilePicture` to the URL query string
if (getProfilePicture() != null) {
try {
joiner.add(String.format("%sprofilePicture%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProfilePicture()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `isTopSpeaker` to the URL query string
if (getIsTopSpeaker() != null) {
try {
joiner.add(String.format("%sisTopSpeaker%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIsTopSpeaker()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `links` to the URL query string
if (getLinks() != null) {
for (int i = 0; i < getLinks().size(); i++) {
if (getLinks().get(i) != null) {
joiner.add(getLinks().get(i).toUrlQueryString(String.format("%slinks%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
// add `fullName` to the URL query string
if (getFullName() != null) {
try {
joiner.add(String.format("%sfullName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFullName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `sessions` to the URL query string
if (getSessions() != null) {
for (int i = 0; i < getSessions().size(); i++) {
try {
joiner.add(String.format("%ssessions%s%s=%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
URLEncoder.encode(String.valueOf(getSessions().get(i)), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
}
// add `questionAnswers` to the URL query string
if (getQuestionAnswers() != null) {
for (int i = 0; i < getQuestionAnswers().size(); i++) {
if (getQuestionAnswers().get(i) != null) {
joiner.add(getQuestionAnswers().get(i).toUrlQueryString(String.format("%squestionAnswers%s%s", prefix, suffix,
"".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
}
}
}
return joiner.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy