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

com.google.gerrit.entities.AutoValue_SubmitRequirementExpression 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.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.lang.SuppressWarnings;
import javax.annotation.processing.Generated;

@Generated(
    value = "com.ryanharter.auto.value.gson.AutoValueGsonExtension",
    comments = "https://github.com/rharter/auto-value-gson"
    )
final class AutoValue_SubmitRequirementExpression extends $AutoValue_SubmitRequirementExpression {
  AutoValue_SubmitRequirementExpression(String expressionString) {
    super(expressionString);
  }

  static final class GsonTypeAdapter extends TypeAdapter {
    private volatile TypeAdapter string_adapter;
    private final Gson gson;
    GsonTypeAdapter(Gson gson) {
      this.gson = gson;
    }
    @Override
    @SuppressWarnings("unchecked")
    public void write(JsonWriter jsonWriter, SubmitRequirementExpression object) throws
    IOException {
      if (object == null) {
        jsonWriter.nullValue();
        return;
      }
      jsonWriter.beginObject();
      jsonWriter.name("expressionString");
      if (object.expressionString() == null) {
        jsonWriter.nullValue();
      } else {
        TypeAdapter string_adapter = this.string_adapter;
        if (string_adapter == null) {
          this.string_adapter = string_adapter = gson.getAdapter(String.class);
        }
        string_adapter.write(jsonWriter, object.expressionString());
      }
      jsonWriter.endObject();
    }
    @Override
    @SuppressWarnings("unchecked")
    public SubmitRequirementExpression read(JsonReader jsonReader) throws IOException {
      if (jsonReader.peek() == JsonToken.NULL) {
        jsonReader.nextNull();
        return null;
      }
      jsonReader.beginObject();
      String expressionString = null;
      while (jsonReader.hasNext()) {
        String _name = jsonReader.nextName();
        if (jsonReader.peek() == JsonToken.NULL) {
          jsonReader.nextNull();
          continue;
        }
        switch (_name) {
          default: {
            if ("expressionString".equals(_name)) {
              TypeAdapter string_adapter = this.string_adapter;
              if (string_adapter == null) {
                this.string_adapter = string_adapter = gson.getAdapter(String.class);
              }
              expressionString = string_adapter.read(jsonReader);
              continue;
            }
            jsonReader.skipValue();
          }
        }
      }
      jsonReader.endObject();
      return new AutoValue_SubmitRequirementExpression(expressionString);
    }
    @Override
    public String toString() {
      return new StringBuilder().append("TypeAdapter(").append("SubmitRequirementExpression").append(")").toString();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy