Skip to content

Commit bb137aa

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Migrate YogaNodeType enum to Kotlin (#56792)
Summary: X-link: react/yoga#1953 Pull Request resolved: #56792 Migrate YogaNodeType.java to YogaNodeType.kt by adding NodeType to KOTLIN_ENUM_NAMES in enums.py and regenerating. Reviewed By: fabriziocucci Differential Revision: D104666338 fbshipit-source-id: aed887c3cd1ca5f86e4ce68c38a4c75b5ab7c594
1 parent 1faa665 commit bb137aa

2 files changed

Lines changed: 27 additions & 33 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeType.java

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 YogaNodeType(public val intValue: Int) {
13+
DEFAULT(0),
14+
TEXT(1);
15+
16+
public fun intValue(): Int = intValue
17+
18+
public companion object {
19+
@JvmStatic
20+
public fun fromInt(value: Int): YogaNodeType =
21+
when (value) {
22+
0 -> DEFAULT
23+
1 -> TEXT
24+
else -> throw IllegalArgumentException("Unknown enum value: $value")
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)