mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Migrate YogaGutter enum to Kotlin (#56791)
Summary: X-link: https://github.com/facebook/yoga/pull/1955 Pull Request resolved: https://github.com/facebook/react-native/pull/56791 Migrate YogaGutter.java to YogaGutter.kt by adding Gutter to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666345 fbshipit-source-id: 12dbfc582c07be31cfb37d7a520961bea1f212b4
This commit is contained in:
1 parent
f1b488f5da
commit
26862a0251
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 YogaGutter {
|
||||
COLUMN(0),
|
||||
ROW(1),
|
||||
ALL(2);
|
||||
|
||||
private final int mIntValue;
|
||||
|
||||
YogaGutter(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
public int intValue() {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static YogaGutter fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return COLUMN;
|
||||
case 1: return ROW;
|
||||
case 2: return ALL;
|
||||
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 YogaGutter(public val intValue: Int) {
|
||||
COLUMN(0),
|
||||
ROW(1),
|
||||
ALL(2);
|
||||
|
||||
public fun intValue(): Int = intValue
|
||||
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
public fun fromInt(value: Int): YogaGutter =
|
||||
when (value) {
|
||||
0 -> COLUMN
|
||||
1 -> ROW
|
||||
2 -> ALL
|
||||
else -> throw IllegalArgumentException("Unknown enum value: $value")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user