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

com.google.gerrit.entities.$AutoValue_SubmitRequirementResult Maven / Gradle / Ivy

There is a newer version: 3.11.0-rc3
Show newest version
package com.google.gerrit.entities;

import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.Boolean;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.lang.SuppressWarnings;
import java.util.Optional;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;

@Generated(
    value = "com.ryanharter.auto.value.gson.AutoValueGsonExtension",
    comments = "https://github.com/rharter/auto-value-gson"
)
abstract class $AutoValue_SubmitRequirementResult extends $$AutoValue_SubmitRequirementResult {
  $AutoValue_SubmitRequirementResult(SubmitRequirement submitRequirement,
      Optional applicabilityExpressionResult,
      Optional submittabilityExpressionResult,
      Optional overrideExpressionResult,
      ObjectId patchSetCommitId, Optional legacy, Optional forced,
      Optional hidden) {
    super(submitRequirement, applicabilityExpressionResult, submittabilityExpressionResult, overrideExpressionResult, patchSetCommitId, legacy, forced, hidden);
  }

  static final class GsonTypeAdapter extends TypeAdapter {
    private volatile TypeAdapter submitRequirement_adapter;
    private volatile TypeAdapter> optional__submitRequirementExpressionResult_adapter;
    private volatile TypeAdapter objectId_adapter;
    private volatile TypeAdapter> optional__boolean_adapter;
    private final Gson gson;
    GsonTypeAdapter(Gson gson) {
      this.gson = gson;
    }
    @Override
    @SuppressWarnings("unchecked")
    public void write(JsonWriter jsonWriter, SubmitRequirementResult object) throws IOException {
      if (object == null) {
        jsonWriter.nullValue();
        return;
      }
      jsonWriter.beginObject();
      jsonWriter.name("submitRequirement");
      if (object.submitRequirement() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter submitRequirement_adapter = this.submitRequirement_adapter;
        if (submitRequirement_adapter == null) {
          this.submitRequirement_adapter = submitRequirement_adapter = gson.getAdapter(SubmitRequirement.class);
        }
        submitRequirement_adapter.write(jsonWriter, object.submitRequirement());
      }
      jsonWriter.name("applicabilityExpressionResult");
      if (object.applicabilityExpressionResult() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
        if (optional__submitRequirementExpressionResult_adapter == null) {
          this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
        }
        optional__submitRequirementExpressionResult_adapter.write(jsonWriter, object.applicabilityExpressionResult());
      }
      jsonWriter.name("submittabilityExpressionResult");
      if (object.submittabilityExpressionResult() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
        if (optional__submitRequirementExpressionResult_adapter == null) {
          this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
        }
        optional__submitRequirementExpressionResult_adapter.write(jsonWriter, object.submittabilityExpressionResult());
      }
      jsonWriter.name("overrideExpressionResult");
      if (object.overrideExpressionResult() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
        if (optional__submitRequirementExpressionResult_adapter == null) {
          this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
        }
        optional__submitRequirementExpressionResult_adapter.write(jsonWriter, object.overrideExpressionResult());
      }
      jsonWriter.name("patchSetCommitId");
      if (object.patchSetCommitId() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter objectId_adapter = this.objectId_adapter;
        if (objectId_adapter == null) {
          this.objectId_adapter = objectId_adapter = gson.getAdapter(ObjectId.class);
        }
        objectId_adapter.write(jsonWriter, object.patchSetCommitId());
      }
      jsonWriter.name("legacy");
      if (object.legacy() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
        if (optional__boolean_adapter == null) {
          this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
        }
        optional__boolean_adapter.write(jsonWriter, object.legacy());
      }
      jsonWriter.name("forced");
      if (object.forced() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
        if (optional__boolean_adapter == null) {
          this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
        }
        optional__boolean_adapter.write(jsonWriter, object.forced());
      }
      jsonWriter.name("hidden");
      if (object.hidden() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
        if (optional__boolean_adapter == null) {
          this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
        }
        optional__boolean_adapter.write(jsonWriter, object.hidden());
      }
      jsonWriter.endObject();
    }
    @Override
    @SuppressWarnings("unchecked")
    public SubmitRequirementResult read(JsonReader jsonReader) throws IOException {
      if (jsonReader.peek() == JsonToken.NULL) {
        jsonReader.nextNull();
        return null;
      }
      jsonReader.beginObject();
      SubmitRequirementResult.Builder builder = SubmitRequirementResult.builder();
      while (jsonReader.hasNext()) {
        String _name = jsonReader.nextName();
        if (jsonReader.peek() == JsonToken.NULL) {
          jsonReader.nextNull();
          continue;
        }
        switch (_name) {
          default: {
            if ("submitRequirement".equals(_name)) {
              TypeAdapter submitRequirement_adapter = this.submitRequirement_adapter;
              if (submitRequirement_adapter == null) {
                this.submitRequirement_adapter = submitRequirement_adapter = gson.getAdapter(SubmitRequirement.class);
              }
              builder.submitRequirement(submitRequirement_adapter.read(jsonReader));
              continue;
            }
            if ("applicabilityExpressionResult".equals(_name)) {
              TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
              if (optional__submitRequirementExpressionResult_adapter == null) {
                this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
              }
              builder.applicabilityExpressionResult(optional__submitRequirementExpressionResult_adapter.read(jsonReader));
              continue;
            }
            if ("submittabilityExpressionResult".equals(_name)) {
              TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
              if (optional__submitRequirementExpressionResult_adapter == null) {
                this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
              }
              builder.submittabilityExpressionResult(optional__submitRequirementExpressionResult_adapter.read(jsonReader));
              continue;
            }
            if ("overrideExpressionResult".equals(_name)) {
              TypeAdapter> optional__submitRequirementExpressionResult_adapter = this.optional__submitRequirementExpressionResult_adapter;
              if (optional__submitRequirementExpressionResult_adapter == null) {
                this.optional__submitRequirementExpressionResult_adapter = optional__submitRequirementExpressionResult_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, SubmitRequirementExpressionResult.class));
              }
              builder.overrideExpressionResult(optional__submitRequirementExpressionResult_adapter.read(jsonReader));
              continue;
            }
            if ("patchSetCommitId".equals(_name)) {
              TypeAdapter objectId_adapter = this.objectId_adapter;
              if (objectId_adapter == null) {
                this.objectId_adapter = objectId_adapter = gson.getAdapter(ObjectId.class);
              }
              builder.patchSetCommitId(objectId_adapter.read(jsonReader));
              continue;
            }
            if ("legacy".equals(_name)) {
              TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
              if (optional__boolean_adapter == null) {
                this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
              }
              builder.legacy(optional__boolean_adapter.read(jsonReader));
              continue;
            }
            if ("forced".equals(_name)) {
              TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
              if (optional__boolean_adapter == null) {
                this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
              }
              builder.forced(optional__boolean_adapter.read(jsonReader));
              continue;
            }
            if ("hidden".equals(_name)) {
              TypeAdapter> optional__boolean_adapter = this.optional__boolean_adapter;
              if (optional__boolean_adapter == null) {
                this.optional__boolean_adapter = optional__boolean_adapter = (TypeAdapter>) gson.getAdapter(TypeToken.getParameterized(Optional.class, Boolean.class));
              }
              builder.hidden(optional__boolean_adapter.read(jsonReader));
              continue;
            }
            jsonReader.skipValue();
          }
        }
      }
      jsonReader.endObject();
      return builder.build();
    }
    @Override
    public String toString() {
      return new StringBuilder().append("TypeAdapter(").append("SubmitRequirementResult").append(")").toString();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy