mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Migrate YogaWrap enum to Kotlin (#56793)
Summary: X-link: https://github.com/facebook/yoga/pull/1949 Pull Request resolved: https://github.com/facebook/react-native/pull/56793 Migrate YogaWrap.java to YogaWrap.kt by adding Wrap to KOTLIN_ENUM_NAMES in enums.py and regenerating. All enums are now migrated to Kotlin — KOTLIN_ENUM_NAMES now contains all enum names. Reviewed By: fabriziocucci Differential Revision: D104666339 fbshipit-source-id: c30cac3d1f8cd5d8ac863c961ad7c90f4371cc58
This commit is contained in:
1 parent
97cf21dd41
commit
6e262624fc
2 files changed
+29
-35
No files matched your search
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by enums.py
|
||||
|
||||
package com.facebook.yoga;
|
||||
|
||||
public enum YogaWrap {
|
||||
NO_WRAP(0),
|
||||
WRAP(1),
|
||||
WRAP_REVERSE(2);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
YogaWrap(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static YogaWrap fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return NO_WRAP;
|
||||
case 1: return WRAP;
|
||||
case 2: return WRAP_REVERSE;
|
||||
default: throw new IllegalArgumentException("Unknown enum value: " + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// @generated by enums.py
|
||||
|
||||
package com.facebook.yoga
|
||||
|
||||
public enum class YogaWrap(public val intValue: Int) {
|
||||
NO_WRAP(0),
|
||||
WRAP(1),
|
||||
WRAP_REVERSE(2);
|
||||
|
||||
public fun intValue(): Int = intValue
|
||||
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun fromInt(value: Int): YogaWrap =
|
||||
when (value) {
|
||||
0 -> NO_WRAP
|
||||
1 -> WRAP
|
||||
2 -> WRAP_REVERSE
|
||||
else -> throw IllegalArgumentException("Unknown enum value: $value")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user