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_NATIVE_COMPARATOR_WRAPPER((byte)0x1);
12 private final byte value
;
14 ComparatorType(final byte value
) {
19 * <p>Returns the byte value of the enumerations value.</p>
21 * @return byte representation
28 * <p>Get the ComparatorType enumeration value by
29 * passing the byte identifier to this method.</p>
31 * @param byteIdentifier of ComparatorType.
33 * @return ComparatorType instance.
35 * @throws IllegalArgumentException if the comparator type for the byteIdentifier
38 static ComparatorType
getComparatorType(final byte byteIdentifier
) {
39 for (final ComparatorType comparatorType
: ComparatorType
.values()) {
40 if (comparatorType
.getValue() == byteIdentifier
) {
41 return comparatorType
;
45 throw new IllegalArgumentException(
46 "Illegal value provided for ComparatorType.");