All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.xdev.sessionize.model.AllResult Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
/*
 * 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.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import software.xdev.sessionize.model.Category;
import software.xdev.sessionize.model.Question;
import software.xdev.sessionize.model.Room;
import software.xdev.sessionize.model.SessionAll;
import software.xdev.sessionize.model.SpeakerAll;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;

/**
 * AllResult
 */
@JsonPropertyOrder({
  AllResult.JSON_PROPERTY_SESSIONS,
  AllResult.JSON_PROPERTY_SPEAKERS,
  AllResult.JSON_PROPERTY_QUESTIONS,
  AllResult.JSON_PROPERTY_CATEGORIES,
  AllResult.JSON_PROPERTY_ROOMS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AllResult {
  public static final String JSON_PROPERTY_SESSIONS = "sessions";
  private List sessions = new ArrayList<>();

  public static final String JSON_PROPERTY_SPEAKERS = "speakers";
  private List speakers = new ArrayList<>();

  public static final String JSON_PROPERTY_QUESTIONS = "questions";
  private List questions = new ArrayList<>();

  public static final String JSON_PROPERTY_CATEGORIES = "categories";
  private List categories = new ArrayList<>();

  public static final String JSON_PROPERTY_ROOMS = "rooms";
  private List rooms = new ArrayList<>();

  public AllResult() {
  }

  public AllResult sessions(List sessions) {
    
    this.sessions = sessions;
    return this;
  }

  public AllResult addSessionsItem(SessionAll 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 AllResult speakers(List speakers) {
    
    this.speakers = speakers;
    return this;
  }

  public AllResult addSpeakersItem(SpeakerAll speakersItem) {
    if (this.speakers == null) {
      this.speakers = new ArrayList<>();
    }
    this.speakers.add(speakersItem);
    return this;
  }

   /**
   * Get speakers
   * @return speakers
  **/
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_SPEAKERS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getSpeakers() {
    return speakers;
  }


  @JsonProperty(JSON_PROPERTY_SPEAKERS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSpeakers(List speakers) {
    this.speakers = speakers;
  }


  public AllResult questions(List questions) {
    
    this.questions = questions;
    return this;
  }

  public AllResult addQuestionsItem(Question questionsItem) {
    if (this.questions == null) {
      this.questions = new ArrayList<>();
    }
    this.questions.add(questionsItem);
    return this;
  }

   /**
   * Get questions
   * @return questions
  **/
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_QUESTIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getQuestions() {
    return questions;
  }


  @JsonProperty(JSON_PROPERTY_QUESTIONS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setQuestions(List questions) {
    this.questions = questions;
  }


  public AllResult categories(List categories) {
    
    this.categories = categories;
    return this;
  }

  public AllResult addCategoriesItem(Category categoriesItem) {
    if (this.categories == null) {
      this.categories = new ArrayList<>();
    }
    this.categories.add(categoriesItem);
    return this;
  }

   /**
   * Get categories
   * @return categories
  **/
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CATEGORIES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getCategories() {
    return categories;
  }


  @JsonProperty(JSON_PROPERTY_CATEGORIES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setCategories(List categories) {
    this.categories = categories;
  }


  public AllResult rooms(List rooms) {
    
    this.rooms = rooms;
    return this;
  }

  public AllResult addRoomsItem(Room roomsItem) {
    if (this.rooms == null) {
      this.rooms = new ArrayList<>();
    }
    this.rooms.add(roomsItem);
    return this;
  }

   /**
   * Get rooms
   * @return rooms
  **/
  @jakarta.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ROOMS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getRooms() {
    return rooms;
  }


  @JsonProperty(JSON_PROPERTY_ROOMS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setRooms(List rooms) {
    this.rooms = rooms;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AllResult allResult = (AllResult) o;
    return Objects.equals(this.sessions, allResult.sessions) &&
        Objects.equals(this.speakers, allResult.speakers) &&
        Objects.equals(this.questions, allResult.questions) &&
        Objects.equals(this.categories, allResult.categories) &&
        Objects.equals(this.rooms, allResult.rooms);
  }

  @Override
  public int hashCode() {
    return Objects.hash(sessions, speakers, questions, categories, rooms);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AllResult {\n");
    sb.append("    sessions: ").append(toIndentedString(sessions)).append("\n");
    sb.append("    speakers: ").append(toIndentedString(speakers)).append("\n");
    sb.append("    questions: ").append(toIndentedString(questions)).append("\n");
    sb.append("    categories: ").append(toIndentedString(categories)).append("\n");
    sb.append("    rooms: ").append(toIndentedString(rooms)).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 `sessions` to the URL query string
    if (getSessions() != null) {
      for (int i = 0; i < getSessions().size(); i++) {
        if (getSessions().get(i) != null) {
          joiner.add(getSessions().get(i).toUrlQueryString(String.format("%ssessions%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `speakers` to the URL query string
    if (getSpeakers() != null) {
      for (int i = 0; i < getSpeakers().size(); i++) {
        if (getSpeakers().get(i) != null) {
          joiner.add(getSpeakers().get(i).toUrlQueryString(String.format("%sspeakers%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `questions` to the URL query string
    if (getQuestions() != null) {
      for (int i = 0; i < getQuestions().size(); i++) {
        if (getQuestions().get(i) != null) {
          joiner.add(getQuestions().get(i).toUrlQueryString(String.format("%squestions%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `categories` to the URL query string
    if (getCategories() != null) {
      for (int i = 0; i < getCategories().size(); i++) {
        if (getCategories().get(i) != null) {
          joiner.add(getCategories().get(i).toUrlQueryString(String.format("%scategories%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    // add `rooms` to the URL query string
    if (getRooms() != null) {
      for (int i = 0; i < getRooms().size(); i++) {
        if (getRooms().get(i) != null) {
          joiner.add(getRooms().get(i).toUrlQueryString(String.format("%srooms%s%s", prefix, suffix,
              "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix))));
        }
      }
    }

    return joiner.toString();
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy