Update enums.py to generate Kotlin files

This commit is contained in:
Mateo Guzmán
2025-08-09 12:05:19 +02:00
parent 8bf7a34d02
commit 16c82cac8b
3 changed files with 81 additions and 36 deletions

View File

@@ -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 YogaDirection {
INHERIT(0),
LTR(1),
RTL(2);
private final int mIntValue;
YogaDirection(int intValue) {
mIntValue = intValue;
}
public int intValue() {
return mIntValue;
}
public static YogaDirection fromInt(int value) {
switch (value) {
case 0: return INHERIT;
case 1: return LTR;
case 2: return RTL;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
}

View File

@@ -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 YogaDirection(public val intValue: Int) {
INHERIT(0),
LTR(1),
RTL(2);
public fun intValue(): Int = intValue
public companion object {
@JvmStatic
public fun fromInt(value: Int): YogaDirection =
when (value) {
0 -> INHERIT
1 -> LTR
2 -> RTL
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
}