MCPcopy Create free account
hub / github.com/apache/fory / buildClass

Function buildClass

javascript/test/crossLanguage.test.ts:1592–1663  ·  view source on GitHub ↗
(id = 402)

Source from the content-addressed store, hash-verified

1590 });
1591
1592 const buildClass = (id = 402) => {
1593 @Type.struct({ typeId: id })
1594 class NullableComprehensiveCompatible {
1595 // Base non-nullable primitive fields
1596 @Type.int8()
1597 byteField: number = 0;
1598 @Type.int16()
1599 shortField: number = 0;
1600 @Type.int32()
1601 intField: number = 0;
1602 @Type.int64()
1603 longField: number = 0;
1604 @Type.float32()
1605 floatField: number = 0;
1606 @Type.float64()
1607 doubleField: number = 0;
1608 @Type.bool()
1609 boolField: boolean = false;
1610
1611 // Base non-nullable boxed fields (not nullable by default in xlang)
1612 @Type.int32()
1613 boxedInt: number = 0;
1614 @Type.int64()
1615 boxedLong: number = 0;
1616 @Type.float32()
1617 boxedFloat: number = 0;
1618 @Type.float64()
1619 boxedDouble: number = 0;
1620 @Type.bool()
1621 boxedBool = false;
1622
1623 // Base non-nullable reference fields
1624 @Type.string()
1625 stringField: string = "";
1626 @Type.list(Type.string())
1627 listField: string[] = [];
1628 @Type.set(Type.string())
1629 setField: Set<string> = new Set();
1630 @Type.map(Type.string(), Type.string())
1631 mapField: Map<string, string> = new Map();
1632
1633 // Nullable group 1 - boxed types with nullable type decorators
1634 @(Type.int32().setNullable(true))
1635 nullableInt1: number | null = null;
1636
1637 @(Type.int64().setNullable(true))
1638 nullableLong1: number | null = null;
1639
1640 @(Type.float32().setNullable(true))
1641 nullableFloat1: number | null = null;
1642
1643 @(Type.float64().setNullable(true))
1644 nullableDouble1: number | null = null;
1645
1646 @(Type.bool().setNullable(true))
1647 nullableBool1: boolean | null = null;
1648
1649 // Nullable group 2 - reference types with nullable type decorators

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected