Skip to content

Commit e8494d7

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaMeasureMode enum to Kotlin (#1958)
Summary: Pull Request resolved: #1958 X-link: react/react-native#56785 Migrate YogaMeasureMode.java to YogaMeasureMode.kt by adding MeasureMode to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666333 fbshipit-source-id: 649ecf9a670153026e08c54ee45baa6e4a16dd93
1 parent 771f4e2 commit e8494d7

3 files changed

Lines changed: 30 additions & 35 deletions

File tree

enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"Gutter",
110110
"Justify",
111111
"LogLevel",
112+
"MeasureMode",
112113
}
113114

114115
ENUMS_KOTLIN = {name: ENUMS[name] for name in KOTLIN_ENUM_NAMES}

java/com/facebook/yoga/YogaMeasureMode.java

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// @generated by enums.py
9+
10+
package com.facebook.yoga
11+
12+
public enum class YogaMeasureMode(public val intValue: Int) {
13+
UNDEFINED(0),
14+
EXACTLY(1),
15+
AT_MOST(2);
16+
17+
public fun intValue(): Int = intValue
18+
19+
public companion object {
20+
@JvmStatic
21+
public fun fromInt(value: Int): YogaMeasureMode =
22+
when (value) {
23+
0 -> UNDEFINED
24+
1 -> EXACTLY
25+
2 -> AT_MOST
26+
else -> throw IllegalArgumentException("Unknown enum value: $value")
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)