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).
9 JAVA_COMPARATOR((byte)0x0),
10 JAVA_DIRECT_COMPARATOR((byte)0x1),
11 JAVA_NATIVE_COMPARATOR_WRAPPER((byte)0x2);
13 private final byte value
;
15 ComparatorType(final byte value
) {
20 * <p>Returns the byte value of the enumerations value.</p>
22 * @return byte representation
29 * <p>Get the ComparatorType enumeration value by
30 * passing the byte identifier to this method.</p>
32 * @param byteIdentifier of ComparatorType.
34 * @return ComparatorType instance.
36 * @throws IllegalArgumentException if the comparator type for the byteIdentifier
39 static ComparatorType
getComparatorType(final byte byteIdentifier
) {
40 for (final ComparatorType comparatorType
: ComparatorType
.values()) {
41 if (comparatorType
.getValue() == byteIdentifier
) {
42 return comparatorType
;
46 throw new IllegalArgumentException(
47 "Illegal value provided for ComparatorType.");