/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contentwarehouse.v1.model;

/**
 * Additional checksums of the document.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Document AI Warehouse API. For a detailed explanation
 * see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class CompositeDocAdditionalChecksums extends com.google.api.client.json.GenericJson {

  /**
   * Same as ContentChecksum96 but without transient boilerplate.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key("NoTransientChecksum96")
  private java.lang.String noTransientChecksum96;

  /**
   * Deprecated. Use simhash_v2 and simhash_v2_significance instead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key("SimHash") @com.google.api.client.json.JsonString
  private java.math.BigInteger simHash;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key("SimHashIsTrusted")
  private java.lang.Boolean simHashIsTrusted;

  /**
   * Simhash-v2 is generated by SimHashParseHandler, designed as a complete replacement of
   * simhash-v1 (a.k.a. the original simhash above) from ApproxDupsParseHandler. Simhash-v2 uses a
   * revised algorithm so that it is expected to work better in most cases than simhash-v1. They
   * coexist in current transition period, then simhash-v1 will be retired.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.math.BigInteger simhashV2;

  /**
   * Simhash-v2-significance is used to describe the confidence about the corresponding simhash-v2
   * value. It is defined as the average absolute difference from zero of all internal state
   * components when finalizing a simhash-v2 value in HashMultiSetDotCauchy. We used to compare the
   * significance against some pre-defined threshold (default: 20) to get a boolean value
   * "trusted_simhash_v2". However, it is possible that this field is missing while "simhash_v2" is
   * present, in such case (1) Use "SimHashIsTrusted" instead if it is present, AND/OR (2) Assume
   * "simhash_v2" is trusted if its value is non-zero.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double simhashV2Significance;

  /**
   * Same as ContentChecksum96 but without transient boilerplate.
   * @see #decodeNoTransientChecksum96()
   * @return value or {@code null} for none
   */
  public java.lang.String getNoTransientChecksum96() {
    return noTransientChecksum96;
  }

  /**
   * Same as ContentChecksum96 but without transient boilerplate.
   * @see #getNoTransientChecksum96()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeNoTransientChecksum96() {
    return com.google.api.client.util.Base64.decodeBase64(noTransientChecksum96);
  }

  /**
   * Same as ContentChecksum96 but without transient boilerplate.
   * @see #encodeNoTransientChecksum96()
   * @param noTransientChecksum96 noTransientChecksum96 or {@code null} for none
   */
  public CompositeDocAdditionalChecksums setNoTransientChecksum96(java.lang.String noTransientChecksum96) {
    this.noTransientChecksum96 = noTransientChecksum96;
    return this;
  }

  /**
   * Same as ContentChecksum96 but without transient boilerplate.
   * @see #setNoTransientChecksum96()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public CompositeDocAdditionalChecksums encodeNoTransientChecksum96(byte[] noTransientChecksum96) {
    this.noTransientChecksum96 = com.google.api.client.util.Base64.encodeBase64URLSafeString(noTransientChecksum96);
    return this;
  }

  /**
   * Deprecated. Use simhash_v2 and simhash_v2_significance instead.
   * @return value or {@code null} for none
   */
  public java.math.BigInteger getSimHash() {
    return simHash;
  }

  /**
   * Deprecated. Use simhash_v2 and simhash_v2_significance instead.
   * @param simHash simHash or {@code null} for none
   */
  public CompositeDocAdditionalChecksums setSimHash(java.math.BigInteger simHash) {
    this.simHash = simHash;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getSimHashIsTrusted() {
    return simHashIsTrusted;
  }

  /**
   * @param simHashIsTrusted simHashIsTrusted or {@code null} for none
   */
  public CompositeDocAdditionalChecksums setSimHashIsTrusted(java.lang.Boolean simHashIsTrusted) {
    this.simHashIsTrusted = simHashIsTrusted;
    return this;
  }

  /**
   * Simhash-v2 is generated by SimHashParseHandler, designed as a complete replacement of
   * simhash-v1 (a.k.a. the original simhash above) from ApproxDupsParseHandler. Simhash-v2 uses a
   * revised algorithm so that it is expected to work better in most cases than simhash-v1. They
   * coexist in current transition period, then simhash-v1 will be retired.
   * @return value or {@code null} for none
   */
  public java.math.BigInteger getSimhashV2() {
    return simhashV2;
  }

  /**
   * Simhash-v2 is generated by SimHashParseHandler, designed as a complete replacement of
   * simhash-v1 (a.k.a. the original simhash above) from ApproxDupsParseHandler. Simhash-v2 uses a
   * revised algorithm so that it is expected to work better in most cases than simhash-v1. They
   * coexist in current transition period, then simhash-v1 will be retired.
   * @param simhashV2 simhashV2 or {@code null} for none
   */
  public CompositeDocAdditionalChecksums setSimhashV2(java.math.BigInteger simhashV2) {
    this.simhashV2 = simhashV2;
    return this;
  }

  /**
   * Simhash-v2-significance is used to describe the confidence about the corresponding simhash-v2
   * value. It is defined as the average absolute difference from zero of all internal state
   * components when finalizing a simhash-v2 value in HashMultiSetDotCauchy. We used to compare the
   * significance against some pre-defined threshold (default: 20) to get a boolean value
   * "trusted_simhash_v2". However, it is possible that this field is missing while "simhash_v2" is
   * present, in such case (1) Use "SimHashIsTrusted" instead if it is present, AND/OR (2) Assume
   * "simhash_v2" is trusted if its value is non-zero.
   * @return value or {@code null} for none
   */
  public java.lang.Double getSimhashV2Significance() {
    return simhashV2Significance;
  }

  /**
   * Simhash-v2-significance is used to describe the confidence about the corresponding simhash-v2
   * value. It is defined as the average absolute difference from zero of all internal state
   * components when finalizing a simhash-v2 value in HashMultiSetDotCauchy. We used to compare the
   * significance against some pre-defined threshold (default: 20) to get a boolean value
   * "trusted_simhash_v2". However, it is possible that this field is missing while "simhash_v2" is
   * present, in such case (1) Use "SimHashIsTrusted" instead if it is present, AND/OR (2) Assume
   * "simhash_v2" is trusted if its value is non-zero.
   * @param simhashV2Significance simhashV2Significance or {@code null} for none
   */
  public CompositeDocAdditionalChecksums setSimhashV2Significance(java.lang.Double simhashV2Significance) {
    this.simhashV2Significance = simhashV2Significance;
    return this;
  }

  @Override
  public CompositeDocAdditionalChecksums set(String fieldName, Object value) {
    return (CompositeDocAdditionalChecksums) super.set(fieldName, value);
  }

  @Override
  public CompositeDocAdditionalChecksums clone() {
    return (CompositeDocAdditionalChecksums) super.clone();
  }

}
