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

net.gdface.facedb.thrift.client.NotFaceDetectedException Maven / Gradle / Ivy

// Automatically generated by the Thrifty compiler; do not edit!
// Generated on: 2019-09-24T07:53:45.899Z
// Source: J:\facedb\FaceDb.thrift at 79:1
package net.gdface.facedb.thrift.client;

import com.microsoft.thrifty.Adapter;
import com.microsoft.thrifty.Struct;
import com.microsoft.thrifty.StructBuilder;
import com.microsoft.thrifty.TType;
import com.microsoft.thrifty.ThriftField;
import com.microsoft.thrifty.protocol.FieldMetadata;
import com.microsoft.thrifty.protocol.Protocol;
import com.microsoft.thrifty.util.ProtocolUtil;
import java.io.IOException;
import javax.annotation.Generated;

@Generated(
    value = "com.microsoft.thrifty.gen.ThriftyCodeGenerator",
    comments = "https://github.com/microsoft/thrifty"
)
public final class NotFaceDetectedException extends Exception implements Struct {
  public static final Adapter ADAPTER = new NotFaceDetectedExceptionAdapter();

  @ThriftField(
      fieldId = 1,
      isOptional = true
  )
  public final String message;

  @ThriftField(
      fieldId = 2,
      isOptional = true
  )
  public final String causeClass;

  @ThriftField(
      fieldId = 3,
      isOptional = true
  )
  public final String serviceStackTraceMessage;

  @ThriftField(
      fieldId = 4,
      isOptional = true
  )
  public final String causeFields;

  @ThriftField(
      fieldId = 5,
      isRequired = true
  )
  public final Integer codeNum;

  @ThriftField(
      fieldId = 6,
      isRequired = true
  )
  public final Integer faceNum;

  private NotFaceDetectedException(Builder builder) {
    this.message = builder.message;
    this.causeClass = builder.causeClass;
    this.serviceStackTraceMessage = builder.serviceStackTraceMessage;
    this.causeFields = builder.causeFields;
    this.codeNum = builder.codeNum;
    this.faceNum = builder.faceNum;
  }

  @Override
  @SuppressWarnings({"StringEquality", "NumberEquality"})
  public boolean equals(Object other) {
    if (this == other) return true;
    if (other == null) return false;
    if (!(other instanceof NotFaceDetectedException)) return false;
    NotFaceDetectedException that = (NotFaceDetectedException) other;
    return (this.message == that.message || (this.message != null && this.message.equals(that.message)))
        && (this.causeClass == that.causeClass || (this.causeClass != null && this.causeClass.equals(that.causeClass)))
        && (this.serviceStackTraceMessage == that.serviceStackTraceMessage || (this.serviceStackTraceMessage != null && this.serviceStackTraceMessage.equals(that.serviceStackTraceMessage)))
        && (this.causeFields == that.causeFields || (this.causeFields != null && this.causeFields.equals(that.causeFields)))
        && (this.codeNum == that.codeNum || this.codeNum.equals(that.codeNum))
        && (this.faceNum == that.faceNum || this.faceNum.equals(that.faceNum));
  }

  @Override
  public int hashCode() {
    int code = 16777619;
    code ^= (this.message == null) ? 0 : this.message.hashCode();
    code *= 0x811c9dc5;
    code ^= (this.causeClass == null) ? 0 : this.causeClass.hashCode();
    code *= 0x811c9dc5;
    code ^= (this.serviceStackTraceMessage == null) ? 0 : this.serviceStackTraceMessage.hashCode();
    code *= 0x811c9dc5;
    code ^= (this.causeFields == null) ? 0 : this.causeFields.hashCode();
    code *= 0x811c9dc5;
    code ^= this.codeNum.hashCode();
    code *= 0x811c9dc5;
    code ^= this.faceNum.hashCode();
    code *= 0x811c9dc5;
    return code;
  }

  @Override
  public String toString() {
    return "NotFaceDetectedException{message=" + this.message + ", causeClass=" + this.causeClass + ", serviceStackTraceMessage=" + this.serviceStackTraceMessage + ", causeFields=" + this.causeFields + ", codeNum=" + this.codeNum + ", faceNum=" + this.faceNum + "}";
  }

  @Override
  public void write(Protocol protocol) throws IOException {
    ADAPTER.write(protocol, this);
  }

  public static final class Builder implements StructBuilder {
    private String message;

    private String causeClass;

    private String serviceStackTraceMessage;

    private String causeFields;

    private Integer codeNum;

    private Integer faceNum;

    public Builder() {
    }

    public Builder(NotFaceDetectedException struct) {
      this.message = struct.message;
      this.causeClass = struct.causeClass;
      this.serviceStackTraceMessage = struct.serviceStackTraceMessage;
      this.causeFields = struct.causeFields;
      this.codeNum = struct.codeNum;
      this.faceNum = struct.faceNum;
    }

    public Builder message(String message) {
      this.message = message;
      return this;
    }

    public Builder causeClass(String causeClass) {
      this.causeClass = causeClass;
      return this;
    }

    public Builder serviceStackTraceMessage(String serviceStackTraceMessage) {
      this.serviceStackTraceMessage = serviceStackTraceMessage;
      return this;
    }

    public Builder causeFields(String causeFields) {
      this.causeFields = causeFields;
      return this;
    }

    public Builder codeNum(Integer codeNum) {
      if (codeNum == null) {
        throw new NullPointerException("Required field 'codeNum' cannot be null");
      }
      this.codeNum = codeNum;
      return this;
    }

    public Builder faceNum(Integer faceNum) {
      if (faceNum == null) {
        throw new NullPointerException("Required field 'faceNum' cannot be null");
      }
      this.faceNum = faceNum;
      return this;
    }

    @Override
    public NotFaceDetectedException build() {
      if (this.codeNum == null) {
        throw new IllegalStateException("Required field 'codeNum' is missing");
      }
      if (this.faceNum == null) {
        throw new IllegalStateException("Required field 'faceNum' is missing");
      }
      return new NotFaceDetectedException(this);
    }

    @Override
    public void reset() {
      this.message = null;
      this.causeClass = null;
      this.serviceStackTraceMessage = null;
      this.causeFields = null;
      this.codeNum = null;
      this.faceNum = null;
    }
  }

  private static final class NotFaceDetectedExceptionAdapter implements Adapter {
    @Override
    public void write(Protocol protocol, NotFaceDetectedException struct) throws IOException {
      protocol.writeStructBegin("NotFaceDetectedException");
      if (struct.message != null) {
        protocol.writeFieldBegin("message", 1, TType.STRING);
        protocol.writeString(struct.message);
        protocol.writeFieldEnd();
      }
      if (struct.causeClass != null) {
        protocol.writeFieldBegin("causeClass", 2, TType.STRING);
        protocol.writeString(struct.causeClass);
        protocol.writeFieldEnd();
      }
      if (struct.serviceStackTraceMessage != null) {
        protocol.writeFieldBegin("serviceStackTraceMessage", 3, TType.STRING);
        protocol.writeString(struct.serviceStackTraceMessage);
        protocol.writeFieldEnd();
      }
      if (struct.causeFields != null) {
        protocol.writeFieldBegin("causeFields", 4, TType.STRING);
        protocol.writeString(struct.causeFields);
        protocol.writeFieldEnd();
      }
      protocol.writeFieldBegin("codeNum", 5, TType.I32);
      protocol.writeI32(struct.codeNum);
      protocol.writeFieldEnd();
      protocol.writeFieldBegin("faceNum", 6, TType.I32);
      protocol.writeI32(struct.faceNum);
      protocol.writeFieldEnd();
      protocol.writeFieldStop();
      protocol.writeStructEnd();
    }

    @Override
    public NotFaceDetectedException read(Protocol protocol, Builder builder) throws IOException {
      protocol.readStructBegin();
      while (true) {
        FieldMetadata field = protocol.readFieldBegin();
        if (field.typeId == TType.STOP) {
          break;
        }
        switch (field.fieldId) {
          case 1: {
            if (field.typeId == TType.STRING) {
              String value = protocol.readString();
              builder.message(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          case 2: {
            if (field.typeId == TType.STRING) {
              String value = protocol.readString();
              builder.causeClass(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          case 3: {
            if (field.typeId == TType.STRING) {
              String value = protocol.readString();
              builder.serviceStackTraceMessage(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          case 4: {
            if (field.typeId == TType.STRING) {
              String value = protocol.readString();
              builder.causeFields(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          case 5: {
            if (field.typeId == TType.I32) {
              int value = protocol.readI32();
              builder.codeNum(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          case 6: {
            if (field.typeId == TType.I32) {
              int value = protocol.readI32();
              builder.faceNum(value);
            } else {
              ProtocolUtil.skip(protocol, field.typeId);
            }
          }
          break;
          default: {
            ProtocolUtil.skip(protocol, field.typeId);
          }
          break;
        }
        protocol.readFieldEnd();
      }
      protocol.readStructEnd();
      return builder.build();
    }

    @Override
    public NotFaceDetectedException read(Protocol protocol) throws IOException {
      return read(protocol, new Builder());
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy