]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/SanityLevel.java
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / SanityLevel.java
1 package org.rocksdb;
2
3 public enum SanityLevel {
4 NONE((byte) 0x0),
5 LOOSELY_COMPATIBLE((byte) 0x1),
6 EXACT_MATCH((byte) 0xFF);
7
8 private final byte value;
9
10 SanityLevel(final byte value) {
11 this.value = value;
12 }
13
14 /**
15 * Get the internal representation value.
16 *
17 * @return the internal representation value.
18 */
19 // TODO(AR) should be made package-private
20 public byte getValue() {
21 return value;
22 }
23
24 /**
25 * Get the SanityLevel from the internal representation value.
26 *
27 * @param value the internal representation value.
28 *
29 * @return the SanityLevel
30 *
31 * @throws IllegalArgumentException if the value does not match a
32 * SanityLevel
33 */
34 static SanityLevel fromValue(final byte value) throws IllegalArgumentException {
35 for (final SanityLevel level : SanityLevel.values()) {
36 if (level.value == value) {
37 return level;
38 }
39 }
40 throw new IllegalArgumentException("Unknown value for SanityLevel: " + value);
41 }
42 }