mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-15 07:28:31 +08:00
Autogenerate enum defenitions for all languages
Reviewed By: gkassabli Differential Revision: D4174263 fbshipit-source-id: 478961a8f683e196704d3c6ea1505a05c85fcb10
This commit is contained in:
committed by
Facebook Github Bot
parent
27ae04cabd
commit
ffcdf25281
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
package com.facebook.csslayout;
|
||||
|
||||
public enum CSSLogLevel {
|
||||
ERROR(0),
|
||||
WARN(1),
|
||||
INFO(2),
|
||||
DEBUG(3),
|
||||
VERBOSE(4);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSLogLevel(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSLogLevel fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return ERROR;
|
||||
case 1: return WARN;
|
||||
case 2: return INFO;
|
||||
case 3: return DEBUG;
|
||||
case 4: return VERBOSE;
|
||||
default: throw new IllegalArgumentException("Unkown enum value: " + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user