SearchIndexStatistics.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.

  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Immutable;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;

  11. /**
  12.  * Statistics for a given index. Statistics are collected periodically and are not guaranteed to always be up-to-date.
  13.  */
  14. @Immutable
  15. public final class SearchIndexStatistics {
  16.     /*
  17.      * The number of documents in the index.
  18.      */
  19.     @JsonProperty(value = "documentCount", required = true, access = JsonProperty.Access.WRITE_ONLY)
  20.     private long documentCount;

  21.     /*
  22.      * The amount of storage in bytes consumed by the index.
  23.      */
  24.     @JsonProperty(value = "storageSize", required = true, access = JsonProperty.Access.WRITE_ONLY)
  25.     private long storageSize;

  26.     /**
  27.      * Creates an instance of SearchIndexStatistics class.
  28.      *
  29.      * @param documentCount the documentCount value to set.
  30.      * @param storageSize the storageSize value to set.
  31.      */
  32.     @JsonCreator
  33.     public SearchIndexStatistics(
  34.             @JsonProperty(value = "documentCount", required = true, access = JsonProperty.Access.WRITE_ONLY)
  35.                     long documentCount,
  36.             @JsonProperty(value = "storageSize", required = true, access = JsonProperty.Access.WRITE_ONLY)
  37.                     long storageSize) {
  38.         this.documentCount = documentCount;
  39.         this.storageSize = storageSize;
  40.     }

  41.     /**
  42.      * Get the documentCount property: The number of documents in the index.
  43.      *
  44.      * @return the documentCount value.
  45.      */
  46.     public long getDocumentCount() {
  47.         return this.documentCount;
  48.     }

  49.     /**
  50.      * Get the storageSize property: The amount of storage in bytes consumed by the index.
  51.      *
  52.      * @return the storageSize value.
  53.      */
  54.     public long getStorageSize() {
  55.         return this.storageSize;
  56.     }
  57. }