Klasse "Variant"
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Das protobuf
-Übertragungsformat verwendet die Variant-Klasse, um zu ermitteln, wie Einzeldaten übermittelt werden können. Kann von anderen Formaten verwendet werden; weitere Informationen finden Sie unter Protokollpuffercodierung.
Variant
wird vom Modul protorpc.messages
bereitgestellt.
"Variant" hat folgende Werte:
BOOL
- Boolescher Wert ("True" oder "False")
BYTES
- String mit 8-Bit-Byte.
DOUBLE
- 64-Bit-Gleitkommazahl.
ENUM
- Enum-Wert (Ganzzahl).
FLOAT
- 32-bit floating point number.
INT32
- Vorzeichenbehaftete 64-Bit-Ganzzahl.
INT64
- Vorzeichenbehaftete 64-Bit-Ganzzahl.
MESSAGE
- Eingebettete Nachricht als Bytestring.
SINT32
- Vorzeichenbehaftete 64-Bit-Ganzzahl. Verwendet die Zickzack-Codierung.
SINT64
- Vorzeichenbehaftete 64-Bit-Ganzzahl. Verwendet die Zickzack-Codierung.
STRING
- String mit UTF-8-codiertem Text.
UINT32
- Vorzeichenlose 32-Bit-Ganzzahl.
UINT64
- Vorzeichenlose 64-Bit-Ganzzahl.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eprotobuf\u003c/code\u003e wire format utilizes the \u003ccode\u003eVariant\u003c/code\u003e class to define data transmission.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e, found in the \u003ccode\u003eprotorpc.messages\u003c/code\u003e module, specifies the type of data being transmitted.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e supports various data types, including boolean, byte strings, floating-point numbers, enums, integers, and embedded messages.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVariant\u003c/code\u003e can utilize ZigZag encoding for signed integers using \u003ccode\u003eSINT32\u003c/code\u003e and \u003ccode\u003eSINT64\u003c/code\u003e types.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSTRING\u003c/code\u003e type is used for UTF-8 encoded text.\u003c/p\u003e\n"]]],[],null,["# The Variant Class\n\nThe `protobuf` wire format uses the Variant class to determine how to transmit a single piece of data. May be used by other formats; see [Protocol Buffers Encoding](https://developers.google.com/protocol-buffers/docs/encoding) for more information.\n\n`Variant` is provided by the `protorpc.messages` module.\n\nVariant has the following values:\n\n`BOOL`\n: Boolean value (True or False)\n\n`BYTES`\n: String of 8-bit bytes.\n\n`DOUBLE`\n: 64-bit floating point number.\n\n`ENUM`\n: Enum value (an integer).\n\n`FLOAT`\n: 32-bit floating point number.\n\n`INT32`\n: 32-bit signed integer.\n\n`INT64`\n: 64-bit signed integer.\n\n`MESSAGE`\n: Embedded message as byte string.\n\n`SINT32`\n: 32-bit signed integer. Uses [ZigZag encoding](https://developers.google.com/protocol-buffers/docs/encoding#types).\n\n`SINT64`\n: 64-bit signed integer. Uses [ZigZag encoding](https://developers.google.com/protocol-buffers/docs/encoding#types).\n\n`STRING`\n: String of UTF-8-encoded text.\n\n`UINT32`\n: 32-bit unsigned integer.\n\n`UINT64`\n: 64-bit unsigned integer."]]