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 WriteStallCondition
{
13 private final byte value
;
15 WriteStallCondition(final byte value
) {
20 * Get the internal representation.
22 * @return the internal representation
29 * Get the WriteStallCondition from the internal representation value.
31 * @return the flush reason.
33 * @throws IllegalArgumentException if the value is unknown.
35 static WriteStallCondition
fromValue(final byte value
) {
36 for (final WriteStallCondition writeStallCondition
: WriteStallCondition
.values()) {
37 if (writeStallCondition
.value
== value
) {
38 return writeStallCondition
;
42 throw new IllegalArgumentException("Illegal value provided for WriteStallCondition: " + value
);