| 1664 | |
| 1665 | const buildClassConsistent = (id = 401) => { |
| 1666 | @Type.struct({ typeId: id }) |
| 1667 | class NullableComprehensiveConsistent { |
| 1668 | // Base non-nullable primitive fields |
| 1669 | @Type.int8() |
| 1670 | byteField: number = 0; |
| 1671 | @Type.int16() |
| 1672 | shortField: number = 0; |
| 1673 | @Type.int32() |
| 1674 | intField: number = 0; |
| 1675 | @Type.int64() |
| 1676 | longField: number = 0; |
| 1677 | @Type.float32() |
| 1678 | floatField: number = 0; |
| 1679 | @Type.float64() |
| 1680 | doubleField: number = 0; |
| 1681 | @Type.bool() |
| 1682 | boolField: boolean = false; |
| 1683 | |
| 1684 | // Base non-nullable reference fields |
| 1685 | @Type.string() |
| 1686 | stringField: string = ""; |
| 1687 | @Type.list(Type.string()) |
| 1688 | listField: string[] = []; |
| 1689 | @Type.set(Type.string()) |
| 1690 | setField: Set<string> = new Set(); |
| 1691 | @Type.map(Type.string(), Type.string()) |
| 1692 | mapField: Map<string, string> = new Map(); |
| 1693 | |
| 1694 | // Nullable group 1 - boxed types with nullable type decorators |
| 1695 | @(Type.int32().setNullable(true)) |
| 1696 | nullableInt: number | null = null; |
| 1697 | |
| 1698 | @(Type.int64().setNullable(true)) |
| 1699 | nullableLong: number | null = null; |
| 1700 | |
| 1701 | @(Type.float32().setNullable(true)) |
| 1702 | nullableFloat: number | null = null; |
| 1703 | |
| 1704 | @(Type.float64().setNullable(true)) |
| 1705 | nullableDouble: number | null = null; |
| 1706 | |
| 1707 | @(Type.bool().setNullable(true)) |
| 1708 | nullableBool: boolean | null = null; |
| 1709 | |
| 1710 | // Nullable group 2 - reference types with nullable type decorators |
| 1711 | @(Type.string().setNullable(true)) |
| 1712 | nullableString: string | null = null; |
| 1713 | |
| 1714 | @(Type.list(Type.string()).setNullable(true)) |
| 1715 | nullableList: string[] | null = null; |
| 1716 | |
| 1717 | @(Type.set(Type.string()).setNullable(true)) |
| 1718 | nullableSet: Set<string> | null = null; |
| 1719 | |
| 1720 | @(Type.map(Type.string(), Type.string()).setNullable(true)) |
| 1721 | nullableMap: Map<string, string> | null = null; |
| 1722 | } |
| 1723 | return NullableComprehensiveConsistent; |