1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
8 public enum BackgroundErrorReason
{
10 COMPACTION((byte) 0x1),
11 WRITE_CALLBACK((byte) 0x2),
14 private final byte value
;
16 BackgroundErrorReason(final byte value
) {
21 * Get the internal representation.
23 * @return the internal representation
30 * Get the BackgroundErrorReason from the internal representation value.
32 * @return the background error reason.
34 * @throws IllegalArgumentException if the value is unknown.
36 static BackgroundErrorReason
fromValue(final byte value
) {
37 for (final BackgroundErrorReason backgroundErrorReason
: BackgroundErrorReason
.values()) {
38 if (backgroundErrorReason
.value
== value
) {
39 return backgroundErrorReason
;
43 throw new IllegalArgumentException(
44 "Illegal value provided for BackgroundErrorReason: " + value
);