/*
 * appNG REST API
 * The REST API for appNG
 *
 * OpenAPI spec version: 1.0.0
 * Contact: matthias.mueller@appng.org
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package org.appng.api.rest.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.appng.api.rest.model.FieldValue;
import org.appng.api.rest.model.Link;
import java.io.Serializable;

/**
 * A single element of a page.
 */
@ApiModel(description = "A single element of a page.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2023-09-06T11:11:24.041+02:00")
public class Element implements Serializable {
  private static final long serialVersionUID = 1L;

  @JsonProperty("fields")
  private List<FieldValue> fields = null;

  @JsonProperty("selected")
  private Boolean selected = null;

  @JsonProperty("links")
  private List<Link> links = null;

  public Element fields(List<FieldValue> fields) {
    this.fields = fields;
    return this;
  }

  public Element addFieldsItem(FieldValue fieldsItem) {
    if (this.fields == null) {
      this.fields = new ArrayList<FieldValue>();
    }
    this.fields.add(fieldsItem);
    return this;
  }

   /**
   * The list of field-values of the element.
   * @return fields
  **/
  @ApiModelProperty(value = "The list of field-values of the element.")
  public List<FieldValue> getFields() {
    return fields;
  }

  public void setFields(List<FieldValue> fields) {
    this.fields = fields;
  }

  public Element selected(Boolean selected) {
    this.selected = selected;
    return this;
  }

   /**
   * Whether this element is selected/active.
   * @return selected
  **/
  @ApiModelProperty(value = "Whether this element is selected/active.")
  public Boolean isSelected() {
    return selected;
  }

  public void setSelected(Boolean selected) {
    this.selected = selected;
  }

  public Element links(List<Link> links) {
    this.links = links;
    return this;
  }

  public Element addLinksItem(Link linksItem) {
    if (this.links == null) {
      this.links = new ArrayList<Link>();
    }
    this.links.add(linksItem);
    return this;
  }

   /**
   * A list of links.
   * @return links
  **/
  @ApiModelProperty(value = "A list of links.")
  public List<Link> getLinks() {
    return links;
  }

  public void setLinks(List<Link> links) {
    this.links = links;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Element element = (Element) o;
    return Objects.equals(this.fields, element.fields) &&
        Objects.equals(this.selected, element.selected) &&
        Objects.equals(this.links, element.links);
  }

  @Override
  public int hashCode() {
    return Objects.hash(fields, selected, links);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Element {\n");
    
    sb.append("    fields: ").append(toIndentedString(fields)).append("\n");
    sb.append("    selected: ").append(toIndentedString(selected)).append("\n");
    sb.append("    links: ").append(toIndentedString(links)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

