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

nl.reinkrul.nuts.extra.LegalBase Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
/*
 * Additional OpenAPI spec for interacting with the Nuts APIs.
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.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 nl.reinkrul.nuts.extra;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import nl.reinkrul.nuts.extra.LegalBaseEvidence;

/**
 * The legal base of the credential.
 */
@ApiModel(description = "The legal base of the credential.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-09-14T14:56:35.909931+02:00[Europe/Amsterdam]")
public class LegalBase {
  /**
   * Gets or Sets consentType
   */
  @JsonAdapter(ConsentTypeEnum.Adapter.class)
  public enum ConsentTypeEnum {
    IMPLIED("implied"),
    
    EXPLICIT("explicit");

    private String value;

    ConsentTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static ConsentTypeEnum fromValue(String value) {
      for (ConsentTypeEnum b : ConsentTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter {
      @Override
      public void write(final JsonWriter jsonWriter, final ConsentTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public ConsentTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return ConsentTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CONSENT_TYPE = "consentType";
  @SerializedName(SERIALIZED_NAME_CONSENT_TYPE)
  private ConsentTypeEnum consentType;

  public static final String SERIALIZED_NAME_EVIDENCE = "evidence";
  @SerializedName(SERIALIZED_NAME_EVIDENCE)
  private LegalBaseEvidence evidence;


  public LegalBase consentType(ConsentTypeEnum consentType) {
    
    this.consentType = consentType;
    return this;
  }

   /**
   * Get consentType
   * @return consentType
  **/
  @ApiModelProperty(required = true, value = "")

  public ConsentTypeEnum getConsentType() {
    return consentType;
  }


  public void setConsentType(ConsentTypeEnum consentType) {
    this.consentType = consentType;
  }


  public LegalBase evidence(LegalBaseEvidence evidence) {
    
    this.evidence = evidence;
    return this;
  }

   /**
   * Get evidence
   * @return evidence
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "")

  public LegalBaseEvidence getEvidence() {
    return evidence;
  }


  public void setEvidence(LegalBaseEvidence evidence) {
    this.evidence = evidence;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    LegalBase legalBase = (LegalBase) o;
    return Objects.equals(this.consentType, legalBase.consentType) &&
        Objects.equals(this.evidence, legalBase.evidence);
  }

  @Override
  public int hashCode() {
    return Objects.hash(consentType, evidence);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class LegalBase {\n");
    sb.append("    consentType: ").append(toIndentedString(consentType)).append("\n");
    sb.append("    evidence: ").append(toIndentedString(evidence)).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    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy