Esempio n. 1
0
 public Builder mergeFault(jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault value) {
   if (result.hasFault()
       && result.fault_
           != jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault
               .getDefaultInstance()) {
     result.fault_ =
         jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.newBuilder(result.fault_)
             .mergeFrom(value)
             .buildPartial();
   } else {
     result.fault_ = value;
   }
   result.hasFault = true;
   return this;
 }
Esempio n. 2
0
 public Builder mergeFrom(
     com.google.protobuf.CodedInputStream input,
     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     throws java.io.IOException {
   com.google.protobuf.UnknownFieldSet.Builder unknownFields =
       com.google.protobuf.UnknownFieldSet.newBuilder(this.getUnknownFields());
   while (true) {
     int tag = input.readTag();
     switch (tag) {
       case 0:
         this.setUnknownFields(unknownFields.build());
         return this;
       default:
         {
           if (!parseUnknownField(
               input, unknownFields,
               extensionRegistry, tag)) {
             this.setUnknownFields(unknownFields.build());
             return this;
           }
           break;
         }
       case 10:
         {
           jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.Builder subBuilder =
               jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.newBuilder();
           input.readMessage(subBuilder, extensionRegistry);
           addHeaders(subBuilder.buildPartial());
           break;
         }
       case 18:
         {
           jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.Builder subBuilder =
               jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.newBuilder();
           if (hasFault()) {
             subBuilder.mergeFrom(getFault());
           }
           input.readMessage(subBuilder, extensionRegistry);
           setFault(subBuilder.buildPartial());
           break;
         }
       case 26:
         {
           setResult(input.readString());
           break;
         }
     }
   }
 }
Esempio n. 3
0
  public static final class TranslateResponse extends com.google.protobuf.GeneratedMessage {
    // Use TranslateResponse.newBuilder() to construct.
    private TranslateResponse() {}

    private static final TranslateResponse defaultInstance = new TranslateResponse();

    public static TranslateResponse getDefaultInstance() {
      return defaultInstance;
    }

    public TranslateResponse getDefaultInstanceForType() {
      return defaultInstance;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return jp.go.nict.langrid.client.protobuf.proto.TranslationProtos
          .internal_static_translation_TranslateResponse_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return jp.go.nict.langrid.client.protobuf.proto.TranslationProtos
          .internal_static_translation_TranslateResponse_fieldAccessorTable;
    }

    // repeated .Header headers = 1;
    public static final int HEADERS_FIELD_NUMBER = 1;
    private java.util.List<jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header> headers_ =
        java.util.Collections.emptyList();

    public java.util.List<jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>
        getHeadersList() {
      return headers_;
    }

    public int getHeadersCount() {
      return headers_.size();
    }

    public jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header getHeaders(int index) {
      return headers_.get(index);
    }

    // optional .Fault fault = 2;
    public static final int FAULT_FIELD_NUMBER = 2;
    private boolean hasFault;
    private jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault fault_ =
        jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.getDefaultInstance();

    public boolean hasFault() {
      return hasFault;
    }

    public jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault getFault() {
      return fault_;
    }

    // optional string result = 3;
    public static final int RESULT_FIELD_NUMBER = 3;
    private boolean hasResult;
    private java.lang.String result_ = "";

    public boolean hasResult() {
      return hasResult;
    }

    public java.lang.String getResult() {
      return result_;
    }

    public final boolean isInitialized() {
      for (jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header element :
          getHeadersList()) {
        if (!element.isInitialized()) return false;
      }
      if (hasFault()) {
        if (!getFault().isInitialized()) return false;
      }
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      for (jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header element :
          getHeadersList()) {
        output.writeMessage(1, element);
      }
      if (hasFault()) {
        output.writeMessage(2, getFault());
      }
      if (hasResult()) {
        output.writeString(3, getResult());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;

    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      for (jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header element :
          getHeadersList()) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, element);
      }
      if (hasFault()) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFault());
      }
      if (hasResult()) {
        size += com.google.protobuf.CodedOutputStream.computeStringSize(3, getResult());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return newBuilder().mergeFrom(data, extensionRegistry).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return newBuilder().mergeDelimitedFrom(input).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseDelimitedFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return newBuilder().mergeDelimitedFrom(input, extensionRegistry).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return newBuilder().mergeFrom(input).buildParsed();
    }

    public static jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
        parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return newBuilder().mergeFrom(input, extensionRegistry).buildParsed();
    }

    public static Builder newBuilder() {
      return Builder.create();
    }

    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder(
        jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse prototype) {
      return newBuilder().mergeFrom(prototype);
    }

    public Builder toBuilder() {
      return newBuilder(this);
    }

    public static final class Builder
        extends com.google.protobuf.GeneratedMessage.Builder<Builder> {
      private jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse result;

      // Construct using
      // jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse.newBuilder()
      private Builder() {}

      private static Builder create() {
        Builder builder = new Builder();
        builder.result =
            new jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse();
        return builder;
      }

      protected jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
          internalGetResult() {
        return result;
      }

      public Builder clear() {
        if (result == null) {
          throw new IllegalStateException("Cannot call clear() after build().");
        }
        result = new jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse();
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(result);
      }

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
            .getDescriptor();
      }

      public jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
          getDefaultInstanceForType() {
        return jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
            .getDefaultInstance();
      }

      public boolean isInitialized() {
        return result.isInitialized();
      }

      public jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse build() {
        if (result != null && !isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return buildPartial();
      }

      private jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
          buildParsed() throws com.google.protobuf.InvalidProtocolBufferException {
        if (!isInitialized()) {
          throw newUninitializedMessageException(result).asInvalidProtocolBufferException();
        }
        return buildPartial();
      }

      public jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
          buildPartial() {
        if (result == null) {
          throw new IllegalStateException("build() has already been called on this Builder.");
        }
        if (result.headers_ != java.util.Collections.EMPTY_LIST) {
          result.headers_ = java.util.Collections.unmodifiableList(result.headers_);
        }
        jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse returnMe =
            result;
        result = null;
        return returnMe;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other
            instanceof
            jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse) {
          return mergeFrom(
              (jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse other) {
        if (other
            == jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.TranslateResponse
                .getDefaultInstance()) return this;
        if (!other.headers_.isEmpty()) {
          if (result.headers_.isEmpty()) {
            result.headers_ =
                new java.util.ArrayList<
                    jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>();
          }
          result.headers_.addAll(other.headers_);
        }
        if (other.hasFault()) {
          mergeFault(other.getFault());
        }
        if (other.hasResult()) {
          setResult(other.getResult());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.protobuf.UnknownFieldSet.Builder unknownFields =
            com.google.protobuf.UnknownFieldSet.newBuilder(this.getUnknownFields());
        while (true) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              this.setUnknownFields(unknownFields.build());
              return this;
            default:
              {
                if (!parseUnknownField(
                    input, unknownFields,
                    extensionRegistry, tag)) {
                  this.setUnknownFields(unknownFields.build());
                  return this;
                }
                break;
              }
            case 10:
              {
                jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.Builder subBuilder =
                    jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.newBuilder();
                input.readMessage(subBuilder, extensionRegistry);
                addHeaders(subBuilder.buildPartial());
                break;
              }
            case 18:
              {
                jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.Builder subBuilder =
                    jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.newBuilder();
                if (hasFault()) {
                  subBuilder.mergeFrom(getFault());
                }
                input.readMessage(subBuilder, extensionRegistry);
                setFault(subBuilder.buildPartial());
                break;
              }
            case 26:
              {
                setResult(input.readString());
                break;
              }
          }
        }
      }

      // repeated .Header headers = 1;
      public java.util.List<jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>
          getHeadersList() {
        return java.util.Collections.unmodifiableList(result.headers_);
      }

      public int getHeadersCount() {
        return result.getHeadersCount();
      }

      public jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header getHeaders(int index) {
        return result.getHeaders(index);
      }

      public Builder setHeaders(
          int index, jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.headers_.set(index, value);
        return this;
      }

      public Builder setHeaders(
          int index,
          jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.Builder builderForValue) {
        result.headers_.set(index, builderForValue.build());
        return this;
      }

      public Builder addHeaders(
          jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header value) {
        if (value == null) {
          throw new NullPointerException();
        }
        if (result.headers_.isEmpty()) {
          result.headers_ =
              new java.util.ArrayList<
                  jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>();
        }
        result.headers_.add(value);
        return this;
      }

      public Builder addHeaders(
          jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header.Builder builderForValue) {
        if (result.headers_.isEmpty()) {
          result.headers_ =
              new java.util.ArrayList<
                  jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>();
        }
        result.headers_.add(builderForValue.build());
        return this;
      }

      public Builder addAllHeaders(
          java.lang.Iterable<? extends jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>
              values) {
        if (result.headers_.isEmpty()) {
          result.headers_ =
              new java.util.ArrayList<
                  jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Header>();
        }
        super.addAll(values, result.headers_);
        return this;
      }

      public Builder clearHeaders() {
        result.headers_ = java.util.Collections.emptyList();
        return this;
      }

      // optional .Fault fault = 2;
      public boolean hasFault() {
        return result.hasFault();
      }

      public jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault getFault() {
        return result.getFault();
      }

      public Builder setFault(jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.hasFault = true;
        result.fault_ = value;
        return this;
      }

      public Builder setFault(
          jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.Builder builderForValue) {
        result.hasFault = true;
        result.fault_ = builderForValue.build();
        return this;
      }

      public Builder mergeFault(jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault value) {
        if (result.hasFault()
            && result.fault_
                != jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault
                    .getDefaultInstance()) {
          result.fault_ =
              jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.newBuilder(result.fault_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          result.fault_ = value;
        }
        result.hasFault = true;
        return this;
      }

      public Builder clearFault() {
        result.hasFault = false;
        result.fault_ =
            jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.getDefaultInstance();
        return this;
      }

      // optional string result = 3;
      public boolean hasResult() {
        return result.hasResult();
      }

      public java.lang.String getResult() {
        return result.getResult();
      }

      public Builder setResult(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        result.hasResult = true;
        result.result_ = value;
        return this;
      }

      public Builder clearResult() {
        result.hasResult = false;
        result.result_ = getDefaultInstance().getResult();
        return this;
      }
    }

    static {
      jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.getDescriptor();
    }

    static {
      jp.go.nict.langrid.client.protobuf.proto.TranslationProtos.internalForceInit();
    }
  }
Esempio n. 4
0
 public Builder clearFault() {
   result.hasFault = false;
   result.fault_ =
       jp.go.nict.langrid.client.protobuf.proto.CommonProtos.Fault.getDefaultInstance();
   return this;
 }