]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/java/src/main/java/org/rocksdb/HistogramType.java
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / HistogramType.java
index ab97a4d257f29f2fec128b8c6ff02130ec85831c..696ee75f2ecf1d89042093dd5413e50f0d3c3408 100644 (file)
@@ -169,12 +169,30 @@ public enum HistogramType {
   }
 
   /**
-   * @deprecated
-   * Exposes internal value of native enum mappings. This method will be marked private in the
-   * next major release.
+   * Returns the byte value of the enumerations value
+   *
+   * @return byte representation
    */
-  @Deprecated
   public byte getValue() {
     return value;
   }
+
+  /**
+   * Get Histogram type by byte value.
+   *
+   * @param value byte representation of HistogramType.
+   *
+   * @return {@link org.rocksdb.HistogramType} instance.
+   * @throws java.lang.IllegalArgumentException if an invalid
+   *     value is provided.
+   */
+  public static HistogramType getHistogramType(final byte value) {
+    for (final HistogramType histogramType : HistogramType.values()) {
+      if (histogramType.getValue() == value) {
+        return histogramType;
+      }
+    }
+    throw new IllegalArgumentException(
+        "Illegal value provided for HistogramType.");
+  }
 }