diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0aaf1a..2c82b6ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,70 @@ All notable changes to **vortex-java** are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.0] — Unreleased + +The headline theme is the **proto-rewrite**: `protobuf-java` is dropped in favour of an +in-tree MemorySegment-native proto3 codec, generated from `.proto` schemas by a new +`proto-gen` module. CLI uber-jar shrinks ~14% and the JDK 25 `sun.misc.Unsafe` stderr +warning (emitted by `protobuf-java`'s `UnsafeUtil`) is gone. + +### Added + +- **`proto-gen` module** — build-time `.proto` to Java code generator. Lexer + parser + + type registry + emitter. Outputs one immutable Java `record` per message and one Java + `enum` per proto enum, each carrying a `@Generated("io.github.dfa1.vortex.protogen.CodeGen")` + annotation. Records expose `decode(MemorySegment, long, long)` static factories and + `encode()` instance methods that operate directly on a memory segment — zero `byte[]` + copy, no `protobuf-java` runtime. +- **`ProtoReader` / `ProtoWriter`** — package-private proto3 wire-format primitives + under `io.github.dfa1.vortex.proto`. Reads varint / sint64 / fixed32 / fixed64 / + length-delimited / packed-repeated payloads, with bounds checks and a 10-byte cap on + varint length. 42 unit tests cover happy path + truncation + bounds. +- **Oneof factories** on generated records (e.g. `ScalarValue.ofInt64Value(123L)`) — + avoids the 11-arg constructor for `ScalarValue`'s oneof. +- **`PatchedMetadata` / `VariantMetadata`** — added to `encodings.proto`. Previously + hand-parsed with `CodedInputStream`; now go through the generated record path. + +### Changed + +- **Build-time tooling**: `regenerate-sources` profile no longer shells out to `protoc`. + Run `./mvnw compile -pl proto-gen` once, then + `./mvnw generate-sources -pl core -P regenerate-sources`. `brew install protobuf` is + no longer needed for normal development. +- **Encoding consumers**: 25 encoding classes (`ALP`, `Bitpacked`, `Dict`, `Rle`, + `Sparse`, `Sequence`, etc.) and 23 test files rewritten to use the new record API. + Constructor calls are positional; field accessors follow proto3 snake_case + (`meta.bit_width()`, not `meta.getBitWidth()`). + +### Removed + +- **`com.google.protobuf:protobuf-java`** dependency dropped from `core`, `reader`, + `writer`, and root `dependencyManagement`. The `protobuf.version` property is gone. + CLI uber-jar: **14 MB → 12 MB**. JDK 25 `sun.misc.Unsafe::arrayBaseOffset` stderr + warning emitted by `UnsafeUtil` on every cold start: **gone**. +- `protoc` no longer required by the build. `brew install flatbuffers` covers `.fbs` + edits; `.proto` edits use the in-process generator. + +### Compatibility + +Wire-format compatibility with the Rust reference implementation is unchanged and is +verified by the full integration suite: + +- `RustWritesJavaReadsIntegrationTest` (10 tests) — Rust writes, Java reads +- `JavaWritesRustReadsIntegrationTest` (194 tests) — Java writes, JNI reads +- `RustJavaReaderComparisonIntegrationTest` (25 tests) — both readers, same file +- `ParquetImportIntegrationTest` (5 tests) — round-trip through ParquetImporter + +All 872 unit + 243 integration tests pass on JDK 25. + +### Performance + +No measurable change on bulk-read benchmarks (`RustVsJavaReadBenchmark.javaReadCascading` +within 1% of main, stdev ±2 ops/s). Proto metadata parse is < 1% of work on multi-million-row +scans; the win is architectural, not throughput. + +[0.6.0]: https://github.com/dfa1/vortex-java/compare/v0.5.0...main + ## [0.5.0] — 2026-06-09 The headline themes are an **interactive inspector TUI** for navigating Vortex files diff --git a/CLAUDE.md b/CLAUDE.md index a6cefaaa..a97244a8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,15 +18,24 @@ Never use `mvn install` or `./mvwn install`. Generated sources (`fbs`/`proto` → Java) are committed under `core/src/main/java`. Normal builds need no external tools. + +Proto-to-Java generation is in-process via the `proto-gen` module (no `protoc` needed). +The generator emits one record per message with a {@code decode(MemorySegment, long, long)} static +factory and an {@code encode()} method that operate directly on a memory segment — no `byte[]` +copy, no `protobuf-java` runtime, no `sun.misc.Unsafe`. + To regenerate after editing `.fbs` or `.proto` schemas: ```bash -brew install flatbuffers protobuf +brew install flatbuffers # only needed for .fbs edits +./mvnw compile -pl proto-gen # build the proto generator (only on .proto edits) ./mvnw generate-sources -pl core -P regenerate-sources # then commit the updated files ``` Any `flatc` version works — the profile strips the version guard automatically. +`flatc` runs every time the profile is active; if you only changed `.proto` files, revert any +spurious `fbs/` diffs with `git checkout -- core/src/main/java/io/github/dfa1/vortex/fbs/`. ```bash # Build all modules @@ -276,18 +285,26 @@ Simple encodings (≤ ~80 lines total, e.g. `NullEncoding`, `BoolEncoding`) are ### Metadata-only encodings -Some encodings store all data in protobuf metadata — no buffers, no children (e.g. `SequenceEncoding`). +Some encodings store all data in proto3 metadata — no buffers, no children (e.g. `SequenceEncoding`). Their `EncodeResult` uses an `EncodeNode` with `metadata` set and an empty `bufferIndices` array: ```java -ByteBuffer metaBuf = ByteBuffer.wrap(meta.toByteArray()); +ByteBuffer metaBuf = ByteBuffer.wrap(meta.encode()); EncodeNode node = new EncodeNode(encodingId, metaBuf, new EncodeNode[0], new int[]{}); -return new +return new EncodeResult(node, List.of(), null, null); +``` -EncodeResult(node, List.of(), null,null); +The decoder reads back via `ctx.metadata()`, not `ctx.buffer(n)`: + +```java +MemorySegment metaSeg = MemorySegment.ofBuffer(ctx.metadata().duplicate()); +FooMetadata meta = FooMetadata.decode(metaSeg, 0, metaSeg.byteSize()); ``` -The decoder reads back via `ctx.metadata()`, not `ctx.buffer(n)`. +Generated proto records live in `io.github.dfa1.vortex.proto`. The runtime decoder +(`ProtoReader`, `ProtoWriter`) is package-private — generated code calls it directly. +For oneof messages (e.g. `ScalarValue`), prefer the static `ofXxxValue(v)` factory over +the 11-arg constructor. ## Testing diff --git a/SECURITY.md b/SECURITY.md index a6ae81b6..a704e1e1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,9 +1,10 @@ # Security Policy `vortex-java` reads and writes the [Vortex columnar file format](https://github.com/vortex-data/vortex). -The reader memory-maps and parses untrusted binary input — trailers, FlatBuffers, Protobuf -metadata, and per-segment encoded data. Robustness against malformed input is treated as a -correctness contract, not a best-effort feature. +The reader memory-maps and parses untrusted binary input — trailers, FlatBuffers, proto3 +metadata (via the in-tree MemorySegment-native `ProtoReader` — no `protobuf-java` runtime), +and per-segment encoded data. Robustness against malformed input is treated as a correctness +contract, not a best-effort feature. ## Supported versions @@ -12,9 +13,9 @@ only if the vulnerability is critical and the fix is mechanical. | Version | Status | | ------- | ----------------------- | -| 0.4.x | Supported | -| 0.3.x | Critical fixes only | -| < 0.3 | End of life | +| 0.6.x | Supported | +| 0.5.x | Critical fixes only | +| < 0.5 | End of life | ## Reporting a vulnerability @@ -46,7 +47,7 @@ In scope: - Any malformed `.vortex` input that causes the reader to throw an exception other than `io.github.dfa1.vortex.core.VortexException` (e.g. `IndexOutOfBoundsException`, `NegativeArraySizeException`, `OutOfMemoryError`, `StackOverflowError`, raw FlatBuffer - runtime exceptions, raw Protobuf parser exceptions, or a JVM crash via the FFM layer). + runtime exceptions, raw `IOException` from the proto3 reader, or a JVM crash via the FFM layer). - Any malformed `.vortex` input that causes the reader to allocate memory disproportionate to its on-disk size (zip-bomb-style amplification). - Any malformed `.vortex` input that causes silent data corruption — wrong row count, @@ -58,9 +59,10 @@ Out of scope: - Denial of service from legitimately large inputs (multi-gigabyte files). Use the resource caps in `ReadOptions` (planned) to bound them. -- Vulnerabilities in third-party dependencies (`vortex-jni`, `zstd-jni`, FlatBuffers runtime, - Protobuf runtime). Report those upstream; we'll bump the dependency once a fixed version - is available. +- Vulnerabilities in third-party dependencies (`vortex-jni`, `zstd-jni`, FlatBuffers runtime). + Report those upstream; we'll bump the dependency once a fixed version is available. + Vortex no longer depends on `protobuf-java` — proto3 parsing is handled by the in-tree + `ProtoReader` (issues there are in scope). - Performance regressions or correctness bugs unrelated to malformed input — please open a regular issue. @@ -76,9 +78,12 @@ exception**. Concretely: self-referential FlatBuffer cycles). - Layout metadata is capped at 4 MiB. - `Decimal` precision is restricted to `[1, 38]`; `scale` to `[0, precision]`. -- `PType` ordinals from Protobuf are bounds-checked. +- `PType` ordinals from proto3 are bounds-checked. - `ConstantEncoding` and dict-layout decode allocate `O(1)` memory regardless of the declared row count (zip-bomb mitigation). +- `ProtoReader` enforces varint length ≤ 10 bytes, rejects truncated len-delim regions, + and validates segment bounds on every read. (0.6.0+ — replaces the `protobuf-java` + parser path; same exception contract.) The regression suite lives under `reader/src/test/java/.../*SecurityTest`. Run with `./mvnw test -Dtest='*SecurityTest'`. diff --git a/core/pom.xml b/core/pom.xml index 0a32f8a1..b4b90110 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -20,10 +20,6 @@ com.google.flatbuffers flatbuffers-java - - com.google.protobuf - protobuf-java - io.airlift aircompressor-v3 @@ -56,7 +52,7 @@ Normal builds need no external tools. To regenerate after editing .fbs or .proto schemas: - brew install flatbuffers protobuf + brew install flatbuffers ./mvnw generate-sources -pl core -P regenerate-sources Then commit the updated files. Any flatc version works — the profile strips the version guard automatically. @@ -93,18 +89,27 @@ - + - protoc-generate + protogen-generate generate-sources exec - protoc + java - --java_out=${project.basedir}/src/main/java - --proto_path=${project.basedir}/src/main/proto + -cp + ${project.basedir}/../proto-gen/target/classes + io.github.dfa1.vortex.protogen.Main + --out + ${project.basedir}/src/main/java/io/github/dfa1/vortex/proto ${project.basedir}/src/main/proto/dtype.proto ${project.basedir}/src/main/proto/scalar.proto ${project.basedir}/src/main/proto/encodings.proto diff --git a/core/src/main/java/io/github/dfa1/vortex/core/ArrayStats.java b/core/src/main/java/io/github/dfa1/vortex/core/ArrayStats.java index 0a8d27e2..3cb5f2bf 100644 --- a/core/src/main/java/io/github/dfa1/vortex/core/ArrayStats.java +++ b/core/src/main/java/io/github/dfa1/vortex/core/ArrayStats.java @@ -1,9 +1,11 @@ package io.github.dfa1.vortex.core; -import com.google.protobuf.InvalidProtocolBufferException; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; +import java.io.IOException; +import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; /// Per-array statistics embedded in the encoding tree. /// @@ -52,18 +54,31 @@ private static Object decodeScalar(ByteBuffer bytes) { return null; } try { - ScalarProtos.ScalarValue sv = ScalarProtos.ScalarValue.parseFrom(bytes.duplicate()); - return switch (sv.getKindCase()) { - case INT64_VALUE -> sv.getInt64Value(); - case UINT64_VALUE -> sv.getUint64Value(); - case F32_VALUE -> sv.getF32Value(); - case F64_VALUE -> sv.getF64Value(); - case BOOL_VALUE -> sv.getBoolValue(); - case STRING_VALUE -> sv.getStringValue(); - case BYTES_VALUE -> sv.getBytesValue().toStringUtf8(); - default -> null; - }; - } catch (InvalidProtocolBufferException e) { + MemorySegment seg = MemorySegment.ofBuffer(bytes.duplicate()); + ScalarValue sv = ScalarValue.decode(seg, 0, seg.byteSize()); + if (sv.int64_value() != null) { + return sv.int64_value(); + } + if (sv.uint64_value() != null) { + return sv.uint64_value(); + } + if (sv.f32_value() != null) { + return sv.f32_value(); + } + if (sv.f64_value() != null) { + return sv.f64_value(); + } + if (sv.bool_value() != null) { + return sv.bool_value(); + } + if (sv.string_value() != null) { + return sv.string_value(); + } + if (sv.bytes_value() != null) { + return new String(sv.bytes_value(), StandardCharsets.UTF_8); + } + return null; + } catch (IOException e) { throw new VortexException("invalid scalar value in array stats", e); } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/AlpEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/AlpEncoding.java index 7cb67759..7e037818 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/AlpEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/AlpEncoding.java @@ -1,15 +1,16 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.DoubleArray; import io.github.dfa1.vortex.core.array.FloatArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ALPMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; +import io.github.dfa1.vortex.proto.ScalarValue; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -189,8 +190,7 @@ private static EncodeResult encodeF64(double[] values, EncodeContext ctx) { EncodeNode encodedNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); if (d.patchIndices().isEmpty()) { - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(d.expE()).setExpF(d.expF()).build().toByteArray(); + byte[] metaBytes = new ALPMetadata(d.expE(), d.expF(), null).encode(); EncodeNode root = new EncodeNode(EncodingId.VORTEX_ALP, ByteBuffer.wrap(metaBytes), new EncodeNode[]{encodedNode}, new int[0]); return new EncodeResult(root, List.of(encodedBuf), d.statsMin(), d.statsMax()); @@ -204,9 +204,8 @@ private static EncodeResult encodeF64(double[] values, EncodeContext ctx) { valBuf.setAtIndex(PTypeIO.LE_DOUBLE, i, d.patchValues().get(i)); } - EncodingProtos.PatchesMetadata patches = buildPatchesMeta(numPatches); - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(d.expE()).setExpF(d.expF()).setPatches(patches).build().toByteArray(); + PatchesMetadata patches = buildPatchesMeta(numPatches); + byte[] metaBytes = new ALPMetadata(d.expE(), d.expF(), patches).encode(); EncodeNode idxNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); EncodeNode valNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 2); @@ -222,8 +221,7 @@ private static EncodeResult encodeF64(double[] values, EncodeContext ctx) { private static CascadeStep encodeCascadeF64(double[] values, EncodeContext ctx) { AlpF64Data d = computeF64(values); if (d.patchIndices().isEmpty()) { - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(d.expE()).setExpF(d.expF()).build().toByteArray(); + byte[] metaBytes = new ALPMetadata(d.expE(), d.expF(), null).encode(); // children[0] will be filled by the compressor after recursing on the ChildSlot EncodeNode partialRoot = new EncodeNode(EncodingId.VORTEX_ALP, ByteBuffer.wrap(metaBytes), new EncodeNode[1], new int[0]); @@ -239,9 +237,8 @@ private static CascadeStep encodeCascadeF64(double[] values, EncodeContext ctx) valBuf.setAtIndex(PTypeIO.LE_DOUBLE, i, d.patchValues().get(i)); } - EncodingProtos.PatchesMetadata patches = buildPatchesMeta(numPatches); - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(d.expE()).setExpF(d.expF()).setPatches(patches).build().toByteArray(); + PatchesMetadata patches = buildPatchesMeta(numPatches); + byte[] metaBytes = new ALPMetadata(d.expE(), d.expF(), patches).encode(); // ownedBuffers[0]=idxBuf, [1]=valBuf; child I64 will be appended after (starting at idx 2) EncodeNode idxNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); @@ -327,8 +324,7 @@ private static EncodeResult encodeF32(float[] values, EncodeContext ctx) { EncodeNode encodedNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); if (patchIndices.isEmpty()) { - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(expE).setExpF(expF).build().toByteArray(); + byte[] metaBytes = new ALPMetadata(expE, expF, null).encode(); EncodeNode root = new EncodeNode(EncodingId.VORTEX_ALP, ByteBuffer.wrap(metaBytes), new EncodeNode[]{encodedNode}, new int[0]); return new EncodeResult(root, List.of(encodedBuf), statsMin, statsMax); @@ -342,13 +338,12 @@ private static EncodeResult encodeF32(float[] values, EncodeContext ctx) { valBuf.setAtIndex(PTypeIO.LE_FLOAT, i, patchValues.get(i)); } - EncodingProtos.PatchesMetadata patches = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(numPatches) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.forNumber(PType.U32.ordinal())) - .build(); - byte[] metaBytes = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(expE).setExpF(expF).setPatches(patches).build().toByteArray(); + PatchesMetadata patches = new PatchesMetadata( + numPatches, + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(PType.U32.ordinal()), + null, null, null); + byte[] metaBytes = new ALPMetadata(expE, expF, patches).encode(); EncodeNode idxNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); EncodeNode valNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 2); @@ -359,20 +354,20 @@ private static EncodeResult encodeF32(float[] values, EncodeContext ctx) { return new EncodeResult(root, List.of(encodedBuf, idxBuf, valBuf), statsMin, statsMax); } - private static EncodingProtos.PatchesMetadata buildPatchesMeta(int numPatches) { - return EncodingProtos.PatchesMetadata.newBuilder() - .setLen(numPatches) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.forNumber(PType.U32.ordinal())) - .build(); + private static PatchesMetadata buildPatchesMeta(int numPatches) { + return new PatchesMetadata( + numPatches, + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(PType.U32.ordinal()), + null, null, null); } private static byte[] scalarF64(double v) { - return ScalarProtos.ScalarValue.newBuilder().setF64Value(v).build().toByteArray(); + return ScalarValue.ofF64Value(v).encode(); } private static byte[] scalarF32(float v) { - return ScalarProtos.ScalarValue.newBuilder().setF32Value(v).build().toByteArray(); + return ScalarValue.ofF32Value(v).encode(); } private record AlpF64Data(int expE, int expF, long[] encodedArr, @@ -387,13 +382,14 @@ private static Array decode(DecodeContext ctx) { ByteBuffer rawMeta = ctx.metadata(); // Proto3 omits fields equal to their default value (0), so ALPMetadata{expE=0,expF=0} // serialises to 0 bytes; treat null/empty metadata as the all-zero default instance. - EncodingProtos.ALPMetadata meta; + ALPMetadata meta; if (rawMeta == null || !rawMeta.hasRemaining()) { - meta = EncodingProtos.ALPMetadata.getDefaultInstance(); + meta = new ALPMetadata(0, 0, null); } else { try { - meta = EncodingProtos.ALPMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = ALPMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_ALP, "invalid metadata", e); } } @@ -402,8 +398,8 @@ private static Array decode(DecodeContext ctx) { throw new VortexException(EncodingId.VORTEX_ALP, "expected primitive dtype, got " + ctx.dtype()); } - int expE = meta.getExpE(); - int expF = meta.getExpF(); + int expE = meta.exp_e(); + int expF = meta.exp_f(); PType ptype = p.ptype(); long n = ctx.rowCount(); @@ -414,7 +410,7 @@ private static Array decode(DecodeContext ctx) { }; } - private static Array decodeF64(DecodeContext ctx, EncodingProtos.ALPMetadata meta, int expE, int expF, long n) { + private static Array decodeF64(DecodeContext ctx, ALPMetadata meta, int expE, int expF, long n) { // Two separate lookups match Rust's left-to-right: (encoded * F10[f]) * IF10[e]. // Precomputing a single factor = F10[f] * IF10[e] then encoded * factor uses different // associativity and can produce different IEEE 754 results for some (expE, expF) pairs. @@ -445,14 +441,14 @@ private static Array decodeF64(DecodeContext ctx, EncodingProtos.ALPMetadata met } } - if (meta.hasPatches()) { - applyPatches(ctx, meta.getPatches(), buf, 8); + if (meta.patches() != null) { + applyPatches(ctx, meta.patches(), buf, 8); } return new DoubleArray(ctx.dtype(), n, buf.asReadOnly()); } - private static Array decodeF32(DecodeContext ctx, EncodingProtos.ALPMetadata meta, int expE, int expF, long n) { + private static Array decodeF32(DecodeContext ctx, ALPMetadata meta, int expE, int expF, long n) { // Two separate lookups match Rust's left-to-right: (encoded * F10[f]) * IF10[e]. float df = F10_F32[expF]; float de = IF10_F32[expE]; @@ -476,18 +472,18 @@ private static Array decodeF32(DecodeContext ctx, EncodingProtos.ALPMetadata met } } - if (meta.hasPatches()) { - applyPatches(ctx, meta.getPatches(), buf32, 4); + if (meta.patches() != null) { + applyPatches(ctx, meta.patches(), buf32, 4); } return new FloatArray(ctx.dtype(), n, buf32.asReadOnly()); } - private static void applyPatches(DecodeContext ctx, EncodingProtos.PatchesMetadata pm, + private static void applyPatches(DecodeContext ctx, PatchesMetadata pm, MemorySegment out, int elemBytes) { - long numPatches = pm.getLen(); - long offset = pm.getOffset(); - PType idxPtype = ptypeFromProto(pm.getIndicesPtype()); + long numPatches = pm.len(); + long offset = pm.offset(); + PType idxPtype = ptypeFromProto(pm.indices_ptype()); int idxBytes = idxPtype.byteSize(); MemorySegment idxSeg = ctx.decodeChildSegment(1, new DType.Primitive(idxPtype, false), numPatches); @@ -519,8 +515,8 @@ private static long readUnsigned(MemorySegment seg, long off, PType ptype) { }; } - private static PType ptypeFromProto(DTypeProtos.PType proto) { - return PType.fromOrdinal(proto.getNumber()); + private static PType ptypeFromProto(io.github.dfa1.vortex.proto.PType proto) { + return PType.fromOrdinal(proto.value()); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/AlpRdEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/AlpRdEncoding.java index baa69809..1936c5e7 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/AlpRdEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/AlpRdEncoding.java @@ -1,14 +1,14 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; +import java.io.IOException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.DoubleArray; import io.github.dfa1.vortex.core.array.FloatArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.ALPRDMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; @@ -286,15 +286,13 @@ private static EncodeResult buildEncodeResult( EncodeNode leftNode = EncodeNode.remapBufferIndices(leftResult.rootNode(), 0); EncodeNode rightNode = EncodeNode.remapBufferIndices(rightResult.rootNode(), leftBufCount); - EncodingProtos.ALPRDMetadata.Builder metaBuilder = EncodingProtos.ALPRDMetadata.newBuilder() - .setRightBitWidth(rightBitWidth) - .setDictLen(dict.length) - .setLeftPartsPtype(DTypeProtos.PType.forNumber(PType.U16.ordinal())); + java.util.List dictList = new ArrayList<>(dict.length); for (short d : dict) { - metaBuilder.addDict(d & 0xFFFF); + dictList.add(d & 0xFFFF); } EncodeNode[] children; + PatchesMetadata patchesMeta = null; if (excPos.isEmpty()) { children = new EncodeNode[]{leftNode, rightNode}; } else { @@ -315,16 +313,21 @@ private static EncodeResult buildEncodeResult( EncodeNode idxNode = EncodeNode.remapBufferIndices(idxResult.rootNode(), idxOffset); EncodeNode valNode = EncodeNode.remapBufferIndices(valResult.rootNode(), idxOffset + idxBufCount); - EncodingProtos.PatchesMetadata patches = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(excPos.size()) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.forNumber(PType.U64.ordinal())) - .build(); - metaBuilder.setPatches(patches); + patchesMeta = new PatchesMetadata( + (long) excPos.size(), + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(PType.U64.ordinal()), + null, null, null); children = new EncodeNode[]{leftNode, rightNode, idxNode, valNode}; } - byte[] metaBytes = metaBuilder.build().toByteArray(); + byte[] metaBytes = new ALPRDMetadata( + rightBitWidth, + dict.length, + dictList, + io.github.dfa1.vortex.proto.PType.fromValue(PType.U16.ordinal()), + patchesMeta + ).encode(); EncodeNode root = new EncodeNode( EncodingId.VORTEX_ALPRD, ByteBuffer.wrap(metaBytes), children, new int[]{}); return new EncodeResult(root, List.copyOf(allBuffers), null, null); @@ -343,11 +346,12 @@ private static EncodeResult emptyResult(DType rightDtype, EncodeContext ctx) { EncodeNode leftNode = EncodeNode.remapBufferIndices(leftResult.rootNode(), 0); EncodeNode rightNode = EncodeNode.remapBufferIndices(rightResult.rootNode(), leftBufCount); - byte[] metaBytes = EncodingProtos.ALPRDMetadata.newBuilder() - .setRightBitWidth(48) - .setDictLen(0) - .setLeftPartsPtype(DTypeProtos.PType.forNumber(PType.U16.ordinal())) - .build().toByteArray(); + byte[] metaBytes = new ALPRDMetadata( + 48, + 0, + java.util.List.of(), + io.github.dfa1.vortex.proto.PType.fromValue(PType.U16.ordinal()), + null).encode(); EncodeNode root = new EncodeNode( EncodingId.VORTEX_ALPRD, ByteBuffer.wrap(metaBytes), @@ -369,18 +373,18 @@ private record Dictionary32(short[] dict, int rightBitWidth) { private static final class Decoder { static Array decode(DecodeContext ctx) { - EncodingProtos.ALPRDMetadata meta = parseMeta(ctx); + ALPRDMetadata meta = parseMeta(ctx); if (!(ctx.dtype() instanceof DType.Primitive p)) { throw new VortexException(EncodingId.VORTEX_ALPRD, "expected primitive dtype, got " + ctx.dtype()); } - int rightBitWidth = meta.getRightBitWidth(); - int dictLen = meta.getDictLen(); + int rightBitWidth = meta.right_bit_width(); + int dictLen = meta.dict_len(); short[] dict = new short[dictLen]; for (int i = 0; i < dictLen; i++) { - dict[i] = (short) (meta.getDict(i) & 0xFFFF); + dict[i] = (short) (meta.dict().get(i) & 0xFFFF); } long n = ctx.rowCount(); @@ -395,7 +399,7 @@ static Array decode(DecodeContext ctx) { } private static Array decodeF64(DecodeContext ctx, - EncodingProtos.ALPRDMetadata meta, + ALPRDMetadata meta, short[] dict, int rightBitWidth, long n) { MemorySegment leftSeg = ctx.decodeChildSegment(0, U16_DTYPE, n); MemorySegment rightSeg = ctx.decodeChildSegment(1, U64_DTYPE, n); @@ -410,15 +414,15 @@ private static Array decodeF64(DecodeContext ctx, out.setAtIndex(PTypeIO.LE_LONG, i, leftBits | rightBits); } - if (meta.hasPatches()) { - applyPatchesF64(ctx, meta.getPatches(), out, rightSeg, rightCap, rightBitWidth); + if (meta.patches() != null) { + applyPatchesF64(ctx, meta.patches(), out, rightSeg, rightCap, rightBitWidth); } return new DoubleArray(ctx.dtype(), n, out.asReadOnly()); } private static Array decodeF32(DecodeContext ctx, - EncodingProtos.ALPRDMetadata meta, + ALPRDMetadata meta, short[] dict, int rightBitWidth, long n) { MemorySegment leftSeg = ctx.decodeChildSegment(0, U16_DTYPE, n); MemorySegment rightSeg = ctx.decodeChildSegment(1, U32_DTYPE, n); @@ -433,19 +437,19 @@ private static Array decodeF32(DecodeContext ctx, out.setAtIndex(PTypeIO.LE_INT, i, leftBits | rightBits); } - if (meta.hasPatches()) { - applyPatchesF32(ctx, meta.getPatches(), out, rightSeg, rightCap, rightBitWidth); + if (meta.patches() != null) { + applyPatchesF32(ctx, meta.patches(), out, rightSeg, rightCap, rightBitWidth); } return new FloatArray(ctx.dtype(), n, out.asReadOnly()); } private static void applyPatchesF64(DecodeContext ctx, - EncodingProtos.PatchesMetadata pm, + PatchesMetadata pm, MemorySegment out, MemorySegment rightSeg, long rightCap, int rightBitWidth) { - long numPatches = pm.getLen(); - long offset = pm.getOffset(); - PType idxPtype = PType.fromOrdinal(pm.getIndicesPtype().getNumber()); + long numPatches = pm.len(); + long offset = pm.offset(); + PType idxPtype = PType.fromOrdinal(pm.indices_ptype().value()); MemorySegment idxSeg = ctx.decodeChildSegment(2, new DType.Primitive(idxPtype, false), numPatches); MemorySegment valSeg = ctx.decodeChildSegment(3, U16_DTYPE, numPatches); @@ -461,11 +465,11 @@ private static void applyPatchesF64(DecodeContext ctx, } } - private static void applyPatchesF32(DecodeContext ctx, EncodingProtos.PatchesMetadata pm, + private static void applyPatchesF32(DecodeContext ctx, PatchesMetadata pm, MemorySegment out, MemorySegment rightSeg, long rightCap, int rightBitWidth) { - long numPatches = pm.getLen(); - long offset = pm.getOffset(); - PType idxPtype = PType.fromOrdinal(pm.getIndicesPtype().getNumber()); + long numPatches = pm.len(); + long offset = pm.offset(); + PType idxPtype = PType.fromOrdinal(pm.indices_ptype().value()); MemorySegment idxSeg = ctx.decodeChildSegment(2, new DType.Primitive(idxPtype, false), numPatches); MemorySegment valSeg = ctx.decodeChildSegment(3, U16_DTYPE, numPatches); @@ -492,14 +496,16 @@ private static long readUnsigned(MemorySegment seg, long off, PType ptype) { }; } - private static EncodingProtos.ALPRDMetadata parseMeta(DecodeContext ctx) { + private static ALPRDMetadata parseMeta(DecodeContext ctx) { ByteBuffer rawMeta = ctx.metadata(); if (rawMeta == null || !rawMeta.hasRemaining()) { - return EncodingProtos.ALPRDMetadata.getDefaultInstance(); + return new ALPRDMetadata(0, 0, java.util.List.of(), + io.github.dfa1.vortex.proto.PType.fromValue(PType.U16.ordinal()), null); } try { - return EncodingProtos.ALPRDMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + return ALPRDMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_ALPRD, "invalid metadata", e); } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/BitpackedEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/BitpackedEncoding.java index 50fceb42..23af45b3 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/BitpackedEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/BitpackedEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -9,9 +8,11 @@ import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.BitPackedMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; +import io.github.dfa1.vortex.proto.ScalarValue; + +import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -97,11 +98,7 @@ static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) { MemorySegment packed = packFastLanes(longs, n, bitWidth, typeBits, ctx.arena()); - byte[] metaBytes = EncodingProtos.BitPackedMetadata.newBuilder() - .setBitWidth(bitWidth) - .setOffset(0) - .build() - .toByteArray(); + byte[] metaBytes = new BitPackedMetadata(bitWidth, 0, null).encode(); byte[] statsMin = n > 0 ? statsBytes(ptype, signedMin) : null; byte[] statsMax = n > 0 ? statsBytes(ptype, signedMax) : null; @@ -223,9 +220,9 @@ private static boolean isUnsigned(PType ptype) { private static byte[] statsBytes(PType ptype, long value) { if (isUnsigned(ptype)) { - return ScalarProtos.ScalarValue.newBuilder().setUint64Value(value).build().toByteArray(); + return ScalarValue.ofUint64Value(value).encode(); } - return ScalarProtos.ScalarValue.newBuilder().setInt64Value(value).build().toByteArray(); + return ScalarValue.ofInt64Value(value).encode(); } private static long readWordFromSeg(MemorySegment seg, int off, int typeBits) { @@ -259,15 +256,16 @@ static Array decode(DecodeContext ctx) { throw new VortexException(EncodingId.FASTLANES_BITPACKED, "missing metadata"); } - EncodingProtos.BitPackedMetadata meta; + BitPackedMetadata meta; try { - meta = EncodingProtos.BitPackedMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = BitPackedMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.FASTLANES_BITPACKED, "invalid metadata", e); } - int bitWidth = meta.getBitWidth(); - int offset = meta.getOffset(); + int bitWidth = meta.bit_width(); + int offset = meta.offset(); PType ptype = ((DType.Primitive) ctx.dtype()).ptype(); int typeBits = ptype.byteSize() * 8; long rowCount = ctx.rowCount(); @@ -276,8 +274,8 @@ static Array decode(DecodeContext ctx) { MemorySegment output = ctx.arena().allocate(rowCount * ptype.byteSize()); fastlanesUnpackToSeg(packed, bitWidth, offset, typeBits, rowCount, output); - if (meta.hasPatches()) { - applyPatches(ctx, meta.getPatches(), output, ptype.byteSize()); + if (meta.patches() != null) { + applyPatches(ctx, meta.patches(), output, ptype.byteSize()); } return switch (ptype) { @@ -694,14 +692,14 @@ private static void unpackLoop64(MemorySegment buf, int bitWidth, int offset, lo } } - private static void applyPatches(DecodeContext ctx, EncodingProtos.PatchesMetadata pm, + private static void applyPatches(DecodeContext ctx, PatchesMetadata pm, MemorySegment out, int elemBytes) { - long numPatches = pm.getLen(); + long numPatches = pm.len(); if (numPatches == 0) { return; } - long offset = pm.getOffset(); - PType idxPtype = ptypeFromProto(pm.getIndicesPtype()); + long offset = pm.offset(); + PType idxPtype = ptypeFromProto(pm.indices_ptype()); MemorySegment idxSeg = ctx.decodeChildSegment(0, new DType.Primitive(idxPtype, false), numPatches); MemorySegment valSeg = ctx.decodeChildSegment(1, ctx.dtype(), numPatches); @@ -730,8 +728,8 @@ private static long readUnsignedIdx(MemorySegment seg, long off, PType ptype) { }; } - private static PType ptypeFromProto(DTypeProtos.PType proto) { - return PType.fromOrdinal(proto.getNumber()); + private static PType ptypeFromProto(io.github.dfa1.vortex.proto.PType proto) { + return PType.fromOrdinal(proto.value()); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/BoolEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/BoolEncoding.java index 0b11401a..19292a07 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/BoolEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/BoolEncoding.java @@ -3,7 +3,7 @@ import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.BoolArray; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -58,10 +58,10 @@ public EncodeResult encode(DType dtype, Object data, EncodeContext ctx) { } } byte[] statsMin = bools.length > 0 - ? ScalarProtos.ScalarValue.newBuilder().setBoolValue(!hasFalse).build().toByteArray() + ? ScalarValue.ofBoolValue(!hasFalse).encode() : null; byte[] statsMax = bools.length > 0 - ? ScalarProtos.ScalarValue.newBuilder().setBoolValue(hasTrue).build().toByteArray() + ? ScalarValue.ofBoolValue(hasTrue).encode() : null; return EncodeResult.simple(encodingId(), encodeBool(bools, ctx.arena()), statsMin, statsMax); } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/ConstantEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/ConstantEncoding.java index 86c9f323..77065b73 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/ConstantEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/ConstantEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -16,8 +15,9 @@ import io.github.dfa1.vortex.core.array.NullArray; import io.github.dfa1.vortex.core.array.ShortArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; import java.nio.ByteBuffer; @@ -75,8 +75,8 @@ private static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) throw new VortexException(EncodingId.VORTEX_CONSTANT, "not a constant array"); } long firstRaw = readFirstRaw(data, ptype); - ScalarProtos.ScalarValue scalar = buildScalar(ptype, firstRaw); - return EncodeResult.simple(EncodingId.VORTEX_CONSTANT, MemorySegment.ofArray(scalar.toByteArray())); + ScalarValue scalar = buildScalar(ptype, firstRaw); + return EncodeResult.simple(EncodingId.VORTEX_CONSTANT, MemorySegment.ofArray(scalar.encode())); } private static long readFirstRaw(Object data, PType ptype) { @@ -119,12 +119,12 @@ static boolean isConstant(Object data, PType ptype) { return true; } - private static ScalarProtos.ScalarValue buildScalar(PType ptype, long rawBits) { + private static ScalarValue buildScalar(PType ptype, long rawBits) { return switch (ptype) { - case U8, U16, U32, U64 -> ScalarProtos.ScalarValue.newBuilder().setUint64Value(rawBits).build(); - case I8, I16, I32, I64 -> ScalarProtos.ScalarValue.newBuilder().setInt64Value(rawBits).build(); - case F32 -> ScalarProtos.ScalarValue.newBuilder().setF32Value(Float.intBitsToFloat((int) rawBits)).build(); - case F64 -> ScalarProtos.ScalarValue.newBuilder().setF64Value(Double.longBitsToDouble(rawBits)).build(); + case U8, U16, U32, U64 -> ScalarValue.ofUint64Value(rawBits); + case I8, I16, I32, I64 -> ScalarValue.ofInt64Value(rawBits); + case F32 -> ScalarValue.ofF32Value(Float.intBitsToFloat((int) rawBits)); + case F64 -> ScalarValue.ofF64Value(Double.longBitsToDouble(rawBits)); default -> throw new VortexException(EncodingId.VORTEX_CONSTANT, "unsupported ptype: " + ptype); }; } @@ -134,10 +134,10 @@ private static final class Decoder { private static Array decode(DecodeContext ctx) { MemorySegment scalarBuf = ctx.buffer(0); - ScalarProtos.ScalarValue scalar; + ScalarValue scalar; try { - scalar = ScalarProtos.ScalarValue.parseFrom(scalarBuf.asByteBuffer()); - } catch (InvalidProtocolBufferException e) { + scalar = ScalarValue.decode(scalarBuf, 0, scalarBuf.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_CONSTANT, "invalid scalar value", e); } @@ -195,9 +195,9 @@ private static Array decode(DecodeContext ctx) { }; } - private static Array decodeDecimal(DecodeContext ctx, ScalarProtos.ScalarValue scalar, long n) { + private static Array decodeDecimal(DecodeContext ctx, ScalarValue scalar, long n) { // Decimal stored as i128 (16 bytes LE) in bytes_value - byte[] elemBytes = scalar.getBytesValue().toByteArray(); + byte[] elemBytes = scalar.bytes_value(); int elemLen = elemBytes.length; MemorySegment outSeg = ctx.arena().allocate(n * elemLen); MemorySegment elemSeg = MemorySegment.ofArray(elemBytes); @@ -207,8 +207,8 @@ private static Array decodeDecimal(DecodeContext ctx, ScalarProtos.ScalarValue s return new GenericArray(ctx.dtype(), n, outSeg.asReadOnly()); } - private static Array decodeBool(DecodeContext ctx, ScalarProtos.ScalarValue scalar, long n) { - boolean value = scalar.getBoolValue(); + private static Array decodeBool(DecodeContext ctx, ScalarValue scalar, long n) { + boolean value = scalar.bool_value() != null && scalar.bool_value(); long numBytes = (n + 7) >>> 3; MemorySegment seg = ctx.arena().allocate(numBytes); if (value) { @@ -219,10 +219,10 @@ private static Array decodeBool(DecodeContext ctx, ScalarProtos.ScalarValue scal return new BoolArray(ctx.dtype(), n, seg.asReadOnly()); } - private static Array decodeString(DecodeContext ctx, ScalarProtos.ScalarValue scalar, long n) { - byte[] strBytes = scalar.hasStringValue() - ? scalar.getStringValue().getBytes(StandardCharsets.UTF_8) - : scalar.getBytesValue().toByteArray(); + private static Array decodeString(DecodeContext ctx, ScalarValue scalar, long n) { + byte[] strBytes = scalar.string_value() != null + ? scalar.string_value().getBytes(StandardCharsets.UTF_8) + : (scalar.bytes_value() != null ? scalar.bytes_value() : new byte[0]); int strLen = strBytes.length; @@ -239,16 +239,20 @@ private static Array decodeString(DecodeContext ctx, ScalarProtos.ScalarValue sc return new VarBinArray(ctx.dtype(), n, bytesSeg.asReadOnly(), offsetsSeg.asReadOnly(), PType.I32); } - private static long scalarToRawBits(ScalarProtos.ScalarValue scalar, PType ptype) { - return switch (scalar.getKindCase()) { - case INT64_VALUE -> scalar.getInt64Value(); - case UINT64_VALUE -> scalar.getUint64Value(); - case F32_VALUE -> Float.floatToRawIntBits(scalar.getF32Value()); - case F64_VALUE -> Double.doubleToRawLongBits(scalar.getF64Value()); - case KIND_NOT_SET -> 0L; - default -> throw new VortexException(EncodingId.VORTEX_CONSTANT, - "unexpected scalar kind " + scalar.getKindCase()); - }; + private static long scalarToRawBits(ScalarValue scalar, PType ptype) { + if (scalar.int64_value() != null) { + return scalar.int64_value(); + } + if (scalar.uint64_value() != null) { + return scalar.uint64_value(); + } + if (scalar.f32_value() != null) { + return Float.floatToRawIntBits(scalar.f32_value()); + } + if (scalar.f64_value() != null) { + return Double.doubleToRawLongBits(scalar.f64_value()); + } + return 0L; } private static void writeRaw(ByteBuffer buf, PType ptype, long rawBits) { diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/DateTimePartsEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/DateTimePartsEncoding.java index cd3c0817..92291bc5 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/DateTimePartsEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/DateTimePartsEncoding.java @@ -1,13 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.GenericArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.DateTimePartsMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; @@ -67,8 +67,8 @@ private static final class Encoder { private static final long SECONDS_PER_DAY = 86_400L; private static final DType I64 = new DType.Primitive(PType.I64, false); private static final DType I64_NULLABLE = new DType.Primitive(PType.I64, true); - private static final DTypeProtos.PType I64_PROTO = - DTypeProtos.PType.forNumber(PType.I64.ordinal()); + private static final io.github.dfa1.vortex.proto.PType I64_PROTO = + io.github.dfa1.vortex.proto.PType.fromValue(PType.I64.ordinal()); static EncodeResult encode(DType.Extension dtype, DateTimePartsData data, EncodeContext ctx) { ByteBuffer extMeta = dtype.metadata(); @@ -120,12 +120,7 @@ static EncodeResult encode(DType.Extension dtype, DateTimePartsData data, Encode EncodeNode secondsNode = EncodeNode.remapBufferIndices(secondsResult.rootNode(), off1); EncodeNode subsecondsNode = EncodeNode.remapBufferIndices(subsecondsResult.rootNode(), off2); - byte[] metaBytes = EncodingProtos.DateTimePartsMetadata.newBuilder() - .setDaysPtype(I64_PROTO) - .setSecondsPtype(I64_PROTO) - .setSubsecondsPtype(I64_PROTO) - .build() - .toByteArray(); + byte[] metaBytes = new DateTimePartsMetadata(I64_PROTO, I64_PROTO, I64_PROTO).encode(); EncodeNode root = new EncodeNode( EncodingId.VORTEX_DATETIMEPARTS, @@ -162,9 +157,7 @@ static CascadeStep encodeCascade(DType.Extension dtype, DateTimePartsData data) subseconds[i] = rem % divisor; } - byte[] metaBytes = EncodingProtos.DateTimePartsMetadata.newBuilder() - .setDaysPtype(I64_PROTO).setSecondsPtype(I64_PROTO).setSubsecondsPtype(I64_PROTO) - .build().toByteArray(); + byte[] metaBytes = new DateTimePartsMetadata(I64_PROTO, I64_PROTO, I64_PROTO).encode(); // 3 null slots filled by the cascading compressor (days, seconds, subseconds) EncodeNode partialRoot = new EncodeNode( @@ -190,18 +183,17 @@ private static Array decode(DecodeContext ctx) { if (meta == null || meta.remaining() == 0) { throw new VortexException(EncodingId.VORTEX_DATETIMEPARTS, "missing metadata"); } - EncodingProtos.DateTimePartsMetadata decoded; + DateTimePartsMetadata decoded; try { - byte[] bytes = new byte[meta.remaining()]; - meta.duplicate().get(bytes); - decoded = EncodingProtos.DateTimePartsMetadata.parseFrom(bytes); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(meta.duplicate()); + decoded = DateTimePartsMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_DATETIMEPARTS, "invalid metadata: " + e.getMessage()); } - PType daysPtype = PType.fromOrdinal(decoded.getDaysPtypeValue()); - PType secondsPtype = PType.fromOrdinal(decoded.getSecondsPtypeValue()); - PType subsecondsPtype = PType.fromOrdinal(decoded.getSubsecondsPtypeValue()); + PType daysPtype = PType.fromOrdinal(decoded.days_ptype().value()); + PType secondsPtype = PType.fromOrdinal(decoded.seconds_ptype().value()); + PType subsecondsPtype = PType.fromOrdinal(decoded.subseconds_ptype().value()); boolean nullable = ctx.dtype().nullable(); Array days = ctx.decodeChild(0, new DType.Primitive(daysPtype, nullable), ctx.rowCount()); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncoding.java index 4756f66f..0d55800a 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncoding.java @@ -1,13 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.GenericArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.DecimalBytePartsMetadata; +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; import java.util.List; @@ -54,12 +54,10 @@ static EncodeResult encode(DType.Decimal dtype, long[] data, EncodeContext ctx) DType mspDtype = new DType.Primitive(PType.I64, dtype.nullable()); EncodeResult mspResult = ctx.lookupEncoding(EncodingId.VORTEX_PRIMITIVE).encode(mspDtype, data, ctx); - EncodingProtos.DecimalBytePartsMetadata proto = EncodingProtos.DecimalBytePartsMetadata.newBuilder() - .setZerothChildPtype( - io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I64.ordinal())) - .setLowerPartCount(0) - .build(); - ByteBuffer metaBuf = ByteBuffer.wrap(proto.toByteArray()); + DecimalBytePartsMetadata proto = new DecimalBytePartsMetadata( + io.github.dfa1.vortex.proto.PType.fromValue(PType.I64.ordinal()), + 0); + ByteBuffer metaBuf = ByteBuffer.wrap(proto.encode()); EncodeNode mspNode = EncodeNode.remapBufferIndices(mspResult.rootNode(), 0); EncodeNode root = new EncodeNode( @@ -75,22 +73,21 @@ private static Array decode(DecodeContext ctx) { if (meta == null || meta.remaining() == 0) { throw new VortexException(EncodingId.VORTEX_DECIMAL_BYTE_PARTS, "missing metadata"); } - EncodingProtos.DecimalBytePartsMetadata decoded; + DecimalBytePartsMetadata decoded; try { - byte[] bytes = new byte[meta.remaining()]; - meta.duplicate().get(bytes); - decoded = EncodingProtos.DecimalBytePartsMetadata.parseFrom(bytes); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(meta.duplicate()); + decoded = DecimalBytePartsMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_DECIMAL_BYTE_PARTS, "invalid metadata: " + e.getMessage()); } - int lowerPartCount = decoded.getLowerPartCount(); + int lowerPartCount = decoded.lower_part_count(); if (lowerPartCount != 0) { throw new VortexException(EncodingId.VORTEX_DECIMAL_BYTE_PARTS, "lower_part_count > 0 not supported, got " + lowerPartCount); } - PType mspPtype = PType.fromOrdinal(decoded.getZerothChildPtypeValue()); + PType mspPtype = PType.fromOrdinal(decoded.zeroth_child_ptype().value()); boolean nullable = ctx.dtype().nullable(); DType mspDtype = new DType.Primitive(mspPtype, nullable); ArrayNode mspNode = ctx.node().children()[0]; diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalEncoding.java index c1a26b43..078b7721 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/DecimalEncoding.java @@ -1,12 +1,12 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.GenericArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.DecimalMetadata; +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; import java.util.List; @@ -55,8 +55,7 @@ static EncodeResult encode(DType.Decimal dtype, MemorySegment data) { throw new VortexException(EncodingId.VORTEX_DECIMAL, "buffer size %d not multiple of byteWidth %d".formatted(data.byteSize(), bw)); } - ByteBuffer metaBuf = ByteBuffer.wrap( - EncodingProtos.DecimalMetadata.newBuilder().setValuesType(valuesType).build().toByteArray()); + ByteBuffer metaBuf = ByteBuffer.wrap(new DecimalMetadata(valuesType).encode()); EncodeNode node = new EncodeNode(EncodingId.VORTEX_DECIMAL, metaBuf, new EncodeNode[0], new int[]{0}); return new EncodeResult(node, List.of(data), null, null); } @@ -101,15 +100,14 @@ private static Array decode(DecodeContext ctx) { if (meta == null || meta.remaining() == 0) { throw new VortexException(EncodingId.VORTEX_DECIMAL, "missing metadata"); } - EncodingProtos.DecimalMetadata decoded; + DecimalMetadata decoded; try { - byte[] bytes = new byte[meta.remaining()]; - meta.duplicate().get(bytes); - decoded = EncodingProtos.DecimalMetadata.parseFrom(bytes); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(meta.duplicate()); + decoded = DecimalMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_DECIMAL, "invalid metadata: " + e.getMessage()); } - int valuesType = decoded.getValuesType(); + int valuesType = decoded.values_type(); int byteWidth = decimalTypeByteWidth(valuesType); MemorySegment buffer = ctx.buffer(0); long expected = ctx.rowCount() * byteWidth; diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/DeltaEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/DeltaEncoding.java index 222791f5..c7c47e81 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/DeltaEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/DeltaEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -9,9 +8,10 @@ import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.DeltaMetadata; +import io.github.dfa1.vortex.proto.ScalarValue; +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; @@ -168,11 +168,7 @@ static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) { MemorySegment basesSeg = fromLongs(basesAll, ptype, ctx.arena()); MemorySegment deltasSeg = fromLongs(deltasAll, ptype, ctx.arena()); - byte[] metaBytes = EncodingProtos.DeltaMetadata.newBuilder() - .setDeltasLen(paddedLen) - .setOffset(0) - .build() - .toByteArray(); + byte[] metaBytes = new DeltaMetadata(paddedLen, 0).encode(); byte[] statsMin = n > 0 ? statsBytes(ptype, minVal) : null; byte[] statsMax = n > 0 ? statsBytes(ptype, maxVal) : null; @@ -260,9 +256,9 @@ private static boolean isUnsigned(PType ptype) { private static byte[] statsBytes(PType ptype, long value) { if (isUnsigned(ptype)) { - return ScalarProtos.ScalarValue.newBuilder().setUint64Value(value).build().toByteArray(); + return ScalarValue.ofUint64Value(value).encode(); } - return ScalarProtos.ScalarValue.newBuilder().setInt64Value(value).build().toByteArray(); + return ScalarValue.ofInt64Value(value).encode(); } } @@ -270,13 +266,14 @@ private static final class Decoder { static Array decode(DecodeContext ctx) { ByteBuffer rawMeta = ctx.metadata(); - EncodingProtos.DeltaMetadata meta; + DeltaMetadata meta; if (rawMeta == null || !rawMeta.hasRemaining()) { - meta = EncodingProtos.DeltaMetadata.getDefaultInstance(); + meta = new DeltaMetadata(0L, 0); } else { try { - meta = EncodingProtos.DeltaMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = DeltaMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.FASTLANES_DELTA, "invalid metadata", e); } } @@ -287,8 +284,8 @@ static Array decode(DecodeContext ctx) { int lanes = lanes(ptype); long mask = typeMask(ptype); - long deltasLen = meta.getDeltasLen(); - int offset = meta.getOffset(); + long deltasLen = meta.deltas_len(); + int offset = meta.offset(); if (deltasLen == 0L) { MemorySegment empty = ctx.arena().allocate(0); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/DictEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/DictEncoding.java index 3fe7b3f1..8244cc3a 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/DictEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/DictEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -12,8 +11,11 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.DictMetadata; +import io.github.dfa1.vortex.proto.ScalarValue; +import io.github.dfa1.vortex.proto.VarBinMetadata; + +import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -145,16 +147,16 @@ private static EncodeResult encodeUtf8(String[] strings, EncodeContext ctx) { writeCodeToSeg(codesBuf, codePType, i, valueMap.get(strings[i])); } - byte[] metaBytes = EncodingProtos.DictMetadata.newBuilder() - .setValuesLen(dictSize) - .setCodesPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(codePType.ordinal())) - .build() - .toByteArray(); + byte[] metaBytes = new DictMetadata( + dictSize, + io.github.dfa1.vortex.proto.PType.fromValue(codePType.ordinal()), + null, + null + ).encode(); - byte[] varBinMetaBytes = EncodingProtos.VarBinMetadata.newBuilder() - .setOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I64.ordinal())) - .build() - .toByteArray(); + byte[] varBinMetaBytes = new VarBinMetadata( + io.github.dfa1.vortex.proto.PType.fromValue(PType.I64.ordinal()) + ).encode(); // Rust layout: children[0]=codes, children[1]=values(VarBin) EncodeNode offsetsNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); @@ -170,10 +172,8 @@ private static EncodeResult encodeUtf8(String[] strings, EncodeContext ctx) { String minStr = valueMap.keySet().stream().min(String::compareTo).orElse(null); String maxStr = valueMap.keySet().stream().max(String::compareTo).orElse(null); - byte[] statsMin = minStr != null - ? ScalarProtos.ScalarValue.newBuilder().setStringValue(minStr).build().toByteArray() : null; - byte[] statsMax = maxStr != null - ? ScalarProtos.ScalarValue.newBuilder().setStringValue(maxStr).build().toByteArray() : null; + byte[] statsMin = minStr != null ? ScalarValue.ofStringValue(minStr).encode() : null; + byte[] statsMax = maxStr != null ? ScalarValue.ofStringValue(maxStr).encode() : null; return new EncodeResult(root, List.of(dictBytesBuf, dictOffsetsBuf, codesBuf), statsMin, statsMax); } @@ -400,15 +400,16 @@ private static Array decodeLegacyJava(DecodeContext ctx, byte codeTypeByte) { } private static Array decodeRustProto(DecodeContext ctx, ByteBuffer metaBuf) { - EncodingProtos.DictMetadata meta; + DictMetadata meta; try { - meta = EncodingProtos.DictMetadata.parseFrom(metaBuf); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(metaBuf); + meta = DictMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_DICT, "invalid proto metadata", e); } - PType codePType = PType.fromOrdinal(meta.getCodesPtype().getNumber()); - long valuesLen = meta.getValuesLen(); + PType codePType = PType.fromOrdinal(meta.codes_ptype().value()); + long valuesLen = meta.values_len(); long rowCount = ctx.rowCount(); PType valPType = ((DType.Primitive) ctx.dtype()).ptype(); int elemSize = valPType.byteSize(); @@ -445,14 +446,15 @@ private static Array decodeUtf8DictLegacy(DecodeContext ctx, ByteBuffer meta) { private static Array decodeUtf8DictProto(DecodeContext ctx, ByteBuffer metaBuf) { // DictMetadata proto (field 1=values_len, field 2=codes_ptype) — same message Rust uses. - EncodingProtos.DictMetadata meta; + DictMetadata meta; try { - meta = EncodingProtos.DictMetadata.parseFrom(metaBuf); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(metaBuf); + meta = DictMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_DICT, "invalid utf8 dict proto metadata", e); } - PType codePType = PType.fromOrdinal(meta.getCodesPtype().getNumber()); - long dictSize = meta.getValuesLen(); + PType codePType = PType.fromOrdinal(meta.codes_ptype().value()); + long dictSize = meta.values_len(); long n = ctx.rowCount(); // Rust layout: children[0]=codes, children[1]=values(VarBin) diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncoding.java index b209ecb8..e6d58c80 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -13,7 +12,9 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -108,10 +109,8 @@ private static ByteBuffer buildForMeta(long ref, PType ptype) { case U8, U16, U32, U64 -> true; default -> false; }; - ScalarProtos.ScalarValue scalar = unsigned - ? ScalarProtos.ScalarValue.newBuilder().setUint64Value(ref).build() - : ScalarProtos.ScalarValue.newBuilder().setInt64Value(ref).build(); - return ByteBuffer.wrap(scalar.toByteArray()); + ScalarValue scalar = unsigned ? ScalarValue.ofUint64Value(ref) : ScalarValue.ofInt64Value(ref); + return ByteBuffer.wrap(scalar.encode()); } /// Returns residuals as a Java primitive array of the correct type (for passing as ChildSlot data). @@ -200,10 +199,11 @@ private static Array decode(DecodeContext ctx) { if (rawMeta == null || !rawMeta.hasRemaining()) { throw new VortexException(EncodingId.FASTLANES_FOR, "missing metadata"); } - ScalarProtos.ScalarValue scalar; + ScalarValue scalar; try { - scalar = ScalarProtos.ScalarValue.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + scalar = ScalarValue.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.FASTLANES_FOR, "invalid metadata", e); } @@ -240,14 +240,14 @@ private static Array decode(DecodeContext ctx) { return validity != null ? new MaskedArray(result, validity) : result; } - private static long referenceValue(ScalarProtos.ScalarValue scalar) { - return switch (scalar.getKindCase()) { - case INT64_VALUE -> scalar.getInt64Value(); - case UINT64_VALUE -> scalar.getUint64Value(); - case KIND_NOT_SET -> 0L; - default -> throw new VortexException(EncodingId.FASTLANES_FOR, - "unexpected scalar kind " + scalar.getKindCase()); - }; + private static long referenceValue(ScalarValue scalar) { + if (scalar.int64_value() != null) { + return scalar.int64_value(); + } + if (scalar.uint64_value() != null) { + return scalar.uint64_value(); + } + return 0L; } private static MemorySegment applyReference(MemorySegment src, long n, PType ptype, long ref, SegmentAllocator arena) { diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/FsstEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/FsstEncoding.java index b37d9c68..5f4a22bb 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/FsstEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/FsstEncoding.java @@ -1,13 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.FSSTMetadata; +import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -144,13 +144,10 @@ static EncodeResult encode(String[] strings, EncodeContext ctx) { codesOffBuf.setAtIndex(PTypeIO.LE_INT, i + 1, (int) off); } - byte[] metaBytes = EncodingProtos.FSSTMetadata.newBuilder() - .setUncompressedLengthsPtype( - io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .setCodesOffsetsPtype( - io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .build() - .toByteArray(); + byte[] metaBytes = new FSSTMetadata( + io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal()), + io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal()) + ).encode(); EncodeNode uncompLensNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 3); EncodeNode codesOffNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 4); @@ -196,15 +193,16 @@ private static Array decode(DecodeContext ctx) { if (rawMeta == null) { throw new VortexException(EncodingId.VORTEX_FSST, "missing metadata"); } - EncodingProtos.FSSTMetadata meta; + FSSTMetadata meta; try { - meta = EncodingProtos.FSSTMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = FSSTMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_FSST, "invalid metadata", e); } - PType uncompLenPType = PType.fromOrdinal(meta.getUncompressedLengthsPtype().getNumber()); - PType codesOffPType = PType.fromOrdinal(meta.getCodesOffsetsPtype().getNumber()); + PType uncompLenPType = PType.fromOrdinal(meta.uncompressed_lengths_ptype().value()); + PType codesOffPType = PType.fromOrdinal(meta.codes_offsets_ptype().value()); long n = ctx.rowCount(); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/ListEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/ListEncoding.java index 7ae41734..87af3912 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/ListEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/ListEncoding.java @@ -1,12 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ListArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.ListMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; @@ -74,11 +75,10 @@ static EncodeResult encode(DType.List dtype, ListData data, EncodeContext ctx) { EncodeNode offsetsNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, elemBufCount); long elementsLen = data.offsets()[(int) data.outerLen()]; - byte[] metaBytes = EncodingProtos.ListMetadata.newBuilder() - .setElementsLen(elementsLen) - .setOffsetPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I64.ordinal())) - .build() - .toByteArray(); + byte[] metaBytes = new ListMetadata( + elementsLen, + io.github.dfa1.vortex.proto.PType.fromValue(PType.I64.ordinal()) + ).encode(); EncodeNode root = new EncodeNode( EncodingId.VORTEX_LIST, @@ -112,15 +112,16 @@ static Array decode(DecodeContext ctx) { "expected 2 or 3 children, got " + nchildren); } - EncodingProtos.ListMetadata meta; + ListMetadata meta; try { - meta = EncodingProtos.ListMetadata.parseFrom(ctx.metadata().duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(ctx.metadata().duplicate()); + meta = ListMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_LIST, "invalid metadata", e); } - long elementsLen = meta.getElementsLen(); - PType offsetPtype = PType.fromOrdinal(meta.getOffsetPtype().getNumber()); + long elementsLen = meta.elements_len(); + PType offsetPtype = PType.fromOrdinal(meta.offset_ptype().value()); long outerLen = ctx.rowCount(); DType elementDtype = listDtype.elementType(); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/ListViewEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/ListViewEncoding.java index bce2d36a..3eef6870 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/ListViewEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/ListViewEncoding.java @@ -1,12 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ListViewArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.ListViewMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; @@ -87,12 +88,11 @@ static EncodeResult encode(DType.List dtype, ListViewData data, EncodeContext ct EncodeNode sizesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, elemBufCount + 1); long elementsLen = java.lang.reflect.Array.getLength(data.elements()); - byte[] metaBytes = EncodingProtos.ListViewMetadata.newBuilder() - .setElementsLen(elementsLen) - .setOffsetPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .setSizePtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .build() - .toByteArray(); + byte[] metaBytes = new ListViewMetadata( + elementsLen, + io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal()), + io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal()) + ).encode(); EncodeNode root = new EncodeNode( EncodingId.VORTEX_LISTVIEW, @@ -126,16 +126,17 @@ static Array decode(DecodeContext ctx) { "expected 3 or 4 children, got " + nchildren); } - EncodingProtos.ListViewMetadata meta; + ListViewMetadata meta; try { - meta = EncodingProtos.ListViewMetadata.parseFrom(ctx.metadata().duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(ctx.metadata().duplicate()); + meta = ListViewMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_LISTVIEW, "invalid metadata", e); } - long elementsLen = meta.getElementsLen(); - PType offsetPtype = PType.fromOrdinal(meta.getOffsetPtype().getNumber()); - PType sizePtype = PType.fromOrdinal(meta.getSizePtype().getNumber()); + long elementsLen = meta.elements_len(); + PType offsetPtype = PType.fromOrdinal(meta.offset_ptype().value()); + PType sizePtype = PType.fromOrdinal(meta.size_ptype().value()); long outerLen = ctx.rowCount(); DType elementDtype = listDtype.elementType(); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/PatchedEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/PatchedEncoding.java index c48be53e..805941df 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/PatchedEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/PatchedEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.CodedInputStream; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -11,6 +10,7 @@ import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; +import io.github.dfa1.vortex.proto.PatchedMetadata; import java.io.IOException; import java.lang.foreign.MemorySegment; @@ -66,20 +66,15 @@ static Array decode(DecodeContext ctx) { throw new VortexException(EncodingId.VORTEX_PATCHED, "missing metadata"); } - long nPatches = 0; - long nLanes = 0; - long offset = 0; + long nPatches; + long nLanes; + long offset; try { - CodedInputStream cin = CodedInputStream.newInstance(rawMeta.duplicate()); - while (!cin.isAtEnd()) { - int tag = cin.readTag(); - switch (tag >>> 3) { - case 1 -> nPatches = Integer.toUnsignedLong(cin.readUInt32()); - case 2 -> nLanes = Integer.toUnsignedLong(cin.readUInt32()); - case 3 -> offset = Integer.toUnsignedLong(cin.readUInt32()); - default -> cin.skipField(tag); - } - } + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + PatchedMetadata meta = PatchedMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + nPatches = Integer.toUnsignedLong(meta.n_patches()); + nLanes = Integer.toUnsignedLong(meta.n_lanes()); + offset = Integer.toUnsignedLong(meta.offset()); } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_PATCHED, "invalid metadata", e); } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/PcoEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/PcoEncoding.java index dc5b0b6c..e9275e77 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/PcoEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/PcoEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -12,7 +11,10 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.PcoChunkInfo; +import io.github.dfa1.vortex.proto.PcoMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -94,7 +96,7 @@ static final class Decoder { ValueLayout.JAVA_LONG_UNALIGNED.withOrder(ByteOrder.LITTLE_ENDIAN); static Array decode(DecodeContext ctx) { - EncodingProtos.PcoMetadata meta = parseMeta(ctx); + PcoMetadata meta = parseMeta(ctx); validateHeader(meta); DType dtype = ctx.dtype(); @@ -128,7 +130,7 @@ static Array decode(DecodeContext ctx) { // decodePage always writes U64 latents (8 bytes per element). MemorySegment rawLatents = ctx.arena().allocate(validCount * Long.BYTES); - int nChunks = meta.getChunksCount(); + int nChunks = meta.chunks().size(); int bufIdx = 0; long rawByteOffset = 0L; @@ -138,7 +140,7 @@ static Array decode(DecodeContext ctx) { int[] batchOffsetBits2 = new int[PcoTansDecoder.BATCH_N]; for (int c = 0; c < nChunks; c++) { - EncodingProtos.PcoChunkInfo chunkInfo = meta.getChunks(c); + PcoChunkInfo chunkInfo = meta.chunks().get(c); MemorySegment chunkMetaBuf = ctx.buffer(bufIdx++); PcoChunkMeta chunkMeta = readChunkMeta(chunkMetaBuf, dtypeSize); @@ -148,16 +150,16 @@ static Array decode(DecodeContext ctx) { // Compute total values in this chunk. int chunkN = 0; - for (int p = 0; p < chunkInfo.getPagesCount(); p++) { - chunkN += chunkInfo.getPages(p).getNValues(); + for (int p = 0; p < chunkInfo.pages().size(); p++) { + chunkN += chunkInfo.pages().get(p).n_values(); } if (deltaVariant == 3) { // Conv1 delta: 64-bit check is in readChunkMeta; 64-bit case never reaches here. PcoTansDecoder primaryTans = PcoTansDecoder.build( chunkMeta.ansSizeLog(), chunkMeta.bins()); - for (int p = 0; p < chunkInfo.getPagesCount(); p++) { - int pageN = chunkInfo.getPages(p).getNValues(); + for (int p = 0; p < chunkInfo.pages().size(); p++) { + int pageN = chunkInfo.pages().get(p).n_values(); MemorySegment pageBuf = ctx.buffer(bufIdx++); rawByteOffset = decodeConv1Page( primaryTans, chunkMeta.ansSizeLog(), @@ -182,8 +184,8 @@ static Array decode(DecodeContext ctx) { int windowN = 1 << chunkMeta.windowNLog(); long mid = typeMid(dtypeSize); long mask = typeMask(dtypeSize); - for (int p = 0; p < chunkInfo.getPagesCount(); p++) { - int pageN = chunkInfo.getPages(p).getNValues(); + for (int p = 0; p < chunkInfo.pages().size(); p++) { + int pageN = chunkInfo.pages().get(p).n_values(); MemorySegment pageBuf = ctx.buffer(bufIdx++); rawByteOffset = decodeLookbackPage( deltaTans, chunkMeta.deltaAnsSizeLog(), @@ -198,8 +200,8 @@ static Array decode(DecodeContext ctx) { // Single-latent var: Classic or Dict. int primaryDtypeSize = (mode == 4) ? 32 : dtypeSize; PcoTansDecoder tans = PcoTansDecoder.build(chunkMeta.ansSizeLog(), chunkMeta.bins()); - for (int p = 0; p < chunkInfo.getPagesCount(); p++) { - int pageN = chunkInfo.getPages(p).getNValues(); + for (int p = 0; p < chunkInfo.pages().size(); p++) { + int pageN = chunkInfo.pages().get(p).n_values(); MemorySegment pageBuf = ctx.buffer(bufIdx++); rawByteOffset = decodeClassicPage(tans, chunkMeta.ansSizeLog(), chunkMeta.deltaOrder(), primaryDtypeSize, @@ -221,8 +223,8 @@ static Array decode(DecodeContext ctx) { MemorySegment rawAdjs = ctx.arena().allocate((long) chunkN * Long.BYTES); long adjByteOffset = 0L; - for (int p = 0; p < chunkInfo.getPagesCount(); p++) { - int pageN = chunkInfo.getPages(p).getNValues(); + for (int p = 0; p < chunkInfo.pages().size(); p++) { + int pageN = chunkInfo.pages().get(p).n_values(); MemorySegment pageBuf = ctx.buffer(bufIdx++); decodeIntMultPage(primaryTans, primaryAnsSizeLog, deltaOrder, secondaryTans, secondaryAnsSizeLog, secondaryDeltaOrder, @@ -853,21 +855,22 @@ private static PcoBin[] readBins(LeBitReader r, int nBins, int ansSizeLog, int d return bins; } - private static EncodingProtos.PcoMetadata parseMeta(DecodeContext ctx) { + private static PcoMetadata parseMeta(DecodeContext ctx) { ByteBuffer raw = ctx.metadata(); if (raw == null) { throw new VortexException(EncodingId.VORTEX_PCO, "missing PcoMetadata"); } try { - return EncodingProtos.PcoMetadata.parseFrom(raw.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(raw.duplicate()); + return PcoMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_PCO, "invalid PcoMetadata: " + e.getMessage()); } } - private static void validateHeader(EncodingProtos.PcoMetadata meta) { - byte[] header = meta.getHeader().toByteArray(); + private static void validateHeader(PcoMetadata meta) { + byte[] header = meta.header(); if (header.length < 2) { throw new VortexException(EncodingId.VORTEX_PCO, "pco header too short: " + header.length + " bytes"); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/PrimitiveEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/PrimitiveEncoding.java index 3aab44af..0794b639 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/PrimitiveEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/PrimitiveEncoding.java @@ -13,7 +13,7 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -293,19 +293,19 @@ private static byte[][] computeStats(PType ptype, Object data) { } private static byte[] scalarI64(long v) { - return ScalarProtos.ScalarValue.newBuilder().setInt64Value(v).build().toByteArray(); + return ScalarValue.ofInt64Value(v).encode(); } private static byte[] scalarU64(long v) { - return ScalarProtos.ScalarValue.newBuilder().setUint64Value(v).build().toByteArray(); + return ScalarValue.ofUint64Value(v).encode(); } private static byte[] scalarF32(float v) { - return ScalarProtos.ScalarValue.newBuilder().setF32Value(v).build().toByteArray(); + return ScalarValue.ofF32Value(v).encode(); } private static byte[] scalarF64(double v) { - return ScalarProtos.ScalarValue.newBuilder().setF64Value(v).build().toByteArray(); + return ScalarValue.ofF64Value(v).encode(); } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/RleEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/RleEncoding.java index bbec258a..ba32c381 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/RleEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/RleEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -15,8 +14,9 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.RLEMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -130,15 +130,14 @@ static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) { PType indicesPtype = PType.U16; PType offsetsPtype = PType.U64; - byte[] metaBytes = EncodingProtos.RLEMetadata.newBuilder() - .setValuesLen(globalValuesCount) - .setIndicesLen(paddedLen) - .setIndicesPtype(DTypeProtos.PType.forNumber(indicesPtype.ordinal())) - .setValuesIdxOffsetsLen(numChunks) - .setValuesIdxOffsetsPtype(DTypeProtos.PType.forNumber(offsetsPtype.ordinal())) - .setOffset(0) - .build() - .toByteArray(); + byte[] metaBytes = new RLEMetadata( + globalValuesCount, + paddedLen, + io.github.dfa1.vortex.proto.PType.fromValue(indicesPtype.ordinal()), + numChunks, + io.github.dfa1.vortex.proto.PType.fromValue(offsetsPtype.ordinal()), + 0L + ).encode(); EncodeNode valuesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); EncodeNode indicesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); @@ -177,15 +176,14 @@ private static EncodeResult encodeEmpty(EncodeContext ctx) { MemorySegment empty = ctx.arena().allocate(0); PType indicesPtype = PType.U16; PType offsetsPtype = PType.U64; - byte[] metaBytes = EncodingProtos.RLEMetadata.newBuilder() - .setValuesLen(0) - .setIndicesLen(0) - .setIndicesPtype(DTypeProtos.PType.forNumber(indicesPtype.ordinal())) - .setValuesIdxOffsetsLen(0) - .setValuesIdxOffsetsPtype(DTypeProtos.PType.forNumber(offsetsPtype.ordinal())) - .setOffset(0) - .build() - .toByteArray(); + byte[] metaBytes = new RLEMetadata( + 0L, + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(indicesPtype.ordinal()), + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(offsetsPtype.ordinal()), + 0L + ).encode(); EncodeNode valuesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); EncodeNode indicesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); EncodeNode offsetsNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 2); @@ -305,19 +303,20 @@ private static final class Decoder { static Array decode(DecodeContext ctx) { ByteBuffer rawMeta = ctx.metadata(); - EncodingProtos.RLEMetadata meta; + RLEMetadata meta; try { - meta = EncodingProtos.RLEMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = RLEMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.FASTLANES_RLE, "invalid metadata", e); } - long valuesLen = meta.getValuesLen(); - long indicesLen = meta.getIndicesLen(); - PType indicesPtype = ptypeFromProto(meta.getIndicesPtype()); - long offsetsLen = meta.getValuesIdxOffsetsLen(); - PType offsetsPtype = ptypeFromProto(meta.getValuesIdxOffsetsPtype()); - int offset = (int) meta.getOffset(); + long valuesLen = meta.values_len(); + long indicesLen = meta.indices_len(); + PType indicesPtype = ptypeFromProto(meta.indices_ptype()); + long offsetsLen = meta.values_idx_offsets_len(); + PType offsetsPtype = ptypeFromProto(meta.values_idx_offsets_ptype()); + int offset = (int) meta.offset(); long rowCount = ctx.rowCount(); if (rowCount == 0 || indicesLen == 0) { @@ -487,8 +486,8 @@ private static MemorySegment fromLongs(long[] decoded, int offset, int count, PT return seg; } - private static PType ptypeFromProto(DTypeProtos.PType proto) { - return PType.fromOrdinal(proto.getNumber()); + private static PType ptypeFromProto(io.github.dfa1.vortex.proto.PType proto) { + return PType.fromOrdinal(proto.value()); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/RunEndEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/RunEndEncoding.java index 73a7f4b6..07379834 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/RunEndEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/RunEndEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -12,8 +11,9 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.RunEndMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; @@ -96,12 +96,11 @@ private static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) PTypeIO.set(valuesBuf, (long) i * elemBytes, ptype, values.get(i)); } - byte[] metaBytes = EncodingProtos.RunEndMetadata.newBuilder() - .setEndsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.U32.ordinal())) - .setNumRuns(numRuns) - .setOffset(0) - .build() - .toByteArray(); + byte[] metaBytes = new RunEndMetadata( + io.github.dfa1.vortex.proto.PType.fromValue(PType.U32.ordinal()), + numRuns, + 0L + ).encode(); EncodeNode endsNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 0); EncodeNode valuesNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); @@ -142,16 +141,17 @@ private static Array decode(DecodeContext ctx) { throw new VortexException(EncodingId.VORTEX_RUNEND, "missing metadata"); } - EncodingProtos.RunEndMetadata meta; + RunEndMetadata meta; try { - meta = EncodingProtos.RunEndMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = RunEndMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_RUNEND, "invalid metadata", e); } - PType endsPtype = ptypeFromProto(meta.getEndsPtype()); - long numRuns = meta.getNumRuns(); - long offset = meta.getOffset(); + PType endsPtype = ptypeFromProto(meta.ends_ptype()); + long numRuns = meta.num_runs(); + long offset = meta.offset(); long n = ctx.rowCount(); DType endsDtype = new DType.Primitive(endsPtype, false); @@ -365,8 +365,8 @@ private static long readVarBinOffset(MemorySegment seg, long i, PType ptype) { }; } - private static PType ptypeFromProto(DTypeProtos.PType proto) { - return PType.fromOrdinal(proto.getNumber()); + private static PType ptypeFromProto(io.github.dfa1.vortex.proto.PType proto) { + return PType.fromOrdinal(proto.value()); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/SequenceEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/SequenceEncoding.java index 8089042c..50a479d0 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/SequenceEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/SequenceEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -12,9 +11,10 @@ import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; +import io.github.dfa1.vortex.proto.SequenceMetadata; +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; @@ -81,8 +81,8 @@ private static EncodeResult encodeInteger(PType pt, Object data) { } } } - ScalarProtos.ScalarValue baseScalar = buildIntScalar(pt, base); - ScalarProtos.ScalarValue mulScalar = buildIntScalar(pt, multiplier); + ScalarValue baseScalar = buildIntScalar(pt, base); + ScalarValue mulScalar = buildIntScalar(pt, multiplier); return buildResult(baseScalar, mulScalar); } @@ -94,9 +94,7 @@ private static EncodeResult encodeF32(float[] data) { throw new VortexException(EncodingId.VORTEX_SEQUENCE, "not an arithmetic sequence at index " + i); } } - ScalarProtos.ScalarValue baseScalar = ScalarProtos.ScalarValue.newBuilder().setF32Value(base).build(); - ScalarProtos.ScalarValue mulScalar = ScalarProtos.ScalarValue.newBuilder().setF32Value(mul).build(); - return buildResult(baseScalar, mulScalar); + return buildResult(ScalarValue.ofF32Value(base), ScalarValue.ofF32Value(mul)); } private static EncodeResult encodeF64(double[] data) { @@ -107,9 +105,7 @@ private static EncodeResult encodeF64(double[] data) { throw new VortexException(EncodingId.VORTEX_SEQUENCE, "not an arithmetic sequence at index " + i); } } - ScalarProtos.ScalarValue baseScalar = ScalarProtos.ScalarValue.newBuilder().setF64Value(base).build(); - ScalarProtos.ScalarValue mulScalar = ScalarProtos.ScalarValue.newBuilder().setF64Value(mul).build(); - return buildResult(baseScalar, mulScalar); + return buildResult(ScalarValue.ofF64Value(base), ScalarValue.ofF64Value(mul)); } private static EncodeResult encodeF16(short[] data) { @@ -123,27 +119,22 @@ private static EncodeResult encodeF16(short[] data) { throw new VortexException(EncodingId.VORTEX_SEQUENCE, "not an arithmetic sequence at index " + i); } } - ScalarProtos.ScalarValue baseScalar = ScalarProtos.ScalarValue.newBuilder() - .setF16Value(Short.toUnsignedLong(baseShort)).build(); - ScalarProtos.ScalarValue mulScalar = ScalarProtos.ScalarValue.newBuilder() - .setF16Value(Short.toUnsignedLong(mulShort)).build(); - return buildResult(baseScalar, mulScalar); + return buildResult( + ScalarValue.ofF16Value(Short.toUnsignedLong(baseShort)), + ScalarValue.ofF16Value(Short.toUnsignedLong(mulShort))); } - private static EncodeResult buildResult(ScalarProtos.ScalarValue base, ScalarProtos.ScalarValue mul) { - EncodingProtos.SequenceMetadata meta = EncodingProtos.SequenceMetadata.newBuilder() - .setBase(base) - .setMultiplier(mul) - .build(); - ByteBuffer metaBuf = ByteBuffer.wrap(meta.toByteArray()); + private static EncodeResult buildResult(ScalarValue base, ScalarValue mul) { + SequenceMetadata meta = new SequenceMetadata(base, mul); + ByteBuffer metaBuf = ByteBuffer.wrap(meta.encode()); EncodeNode node = new EncodeNode(EncodingId.VORTEX_SEQUENCE, metaBuf, new EncodeNode[0], new int[]{}); return new EncodeResult(node, List.of(), null, null); } - private static ScalarProtos.ScalarValue buildIntScalar(PType pt, long value) { + private static ScalarValue buildIntScalar(PType pt, long value) { return switch (pt) { - case U8, U16, U32, U64 -> ScalarProtos.ScalarValue.newBuilder().setUint64Value(value).build(); - default -> ScalarProtos.ScalarValue.newBuilder().setInt64Value(value).build(); + case U8, U16, U32, U64 -> ScalarValue.ofUint64Value(value); + default -> ScalarValue.ofInt64Value(value); }; } @@ -175,10 +166,11 @@ private static Array decode(DecodeContext ctx) { if (metaBuf == null || !metaBuf.hasRemaining()) { throw new VortexException(EncodingId.VORTEX_SEQUENCE, "missing metadata"); } - EncodingProtos.SequenceMetadata meta; + SequenceMetadata meta; try { - meta = EncodingProtos.SequenceMetadata.parseFrom(metaBuf.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment seg = MemorySegment.ofBuffer(metaBuf.duplicate()); + meta = SequenceMetadata.decode(seg, 0, seg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_SEQUENCE, "invalid metadata", e); } @@ -197,10 +189,10 @@ private static Array decode(DecodeContext ctx) { } private static Array decodeInteger( - EncodingProtos.SequenceMetadata meta, PType pt, long n, DType dtype, SegmentAllocator arena + SequenceMetadata meta, PType pt, long n, DType dtype, SegmentAllocator arena ) { - long base = signedValue(meta.getBase()); - long mul = signedValue(meta.getMultiplier()); + long base = signedValue(meta.base()); + long mul = signedValue(meta.multiplier()); int elemBytes = pt.byteSize(); MemorySegment seg = arena.allocate(n * elemBytes); for (long i = 0; i < n; i++) { @@ -222,9 +214,9 @@ private static Array decodeInteger( }; } - private static Array decodeF32(EncodingProtos.SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { - float base = meta.getBase().getF32Value(); - float mul = meta.getMultiplier().getF32Value(); + private static Array decodeF32(SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { + float base = meta.base().f32_value(); + float mul = meta.multiplier().f32_value(); MemorySegment seg = arena.allocate(n * 4L); for (long i = 0; i < n; i++) { seg.setAtIndex(PTypeIO.LE_FLOAT, i, base + i * mul); @@ -232,9 +224,9 @@ private static Array decodeF32(EncodingProtos.SequenceMetadata meta, long n, DTy return new FloatArray(dtype, n, seg); } - private static Array decodeF64(EncodingProtos.SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { - double base = meta.getBase().getF64Value(); - double mul = meta.getMultiplier().getF64Value(); + private static Array decodeF64(SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { + double base = meta.base().f64_value(); + double mul = meta.multiplier().f64_value(); MemorySegment seg = arena.allocate(n * 8L); for (long i = 0; i < n; i++) { seg.setAtIndex(PTypeIO.LE_DOUBLE, i, base + i * mul); @@ -242,9 +234,9 @@ private static Array decodeF64(EncodingProtos.SequenceMetadata meta, long n, DTy return new DoubleArray(dtype, n, seg); } - private static Array decodeF16(EncodingProtos.SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { - short baseShort = (short) meta.getBase().getF16Value(); - short mulShort = (short) meta.getMultiplier().getF16Value(); + private static Array decodeF16(SequenceMetadata meta, long n, DType dtype, SegmentAllocator arena) { + short baseShort = (short) meta.base().f16_value().longValue(); + short mulShort = (short) meta.multiplier().f16_value().longValue(); float base = Float.float16ToFloat(baseShort); float mul = Float.float16ToFloat(mulShort); MemorySegment seg = arena.allocate(n * 2L); @@ -254,14 +246,17 @@ private static Array decodeF16(EncodingProtos.SequenceMetadata meta, long n, DTy return new Float16Array(dtype, n, seg); } - private static long signedValue(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue sv) { - return switch (sv.getKindCase()) { - case INT64_VALUE -> sv.getInt64Value(); - case UINT64_VALUE -> sv.getUint64Value(); - case KIND_NOT_SET -> 0L; - default -> - throw new VortexException(EncodingId.VORTEX_SEQUENCE, "unexpected scalar kind " + sv.getKindCase()); - }; + private static long signedValue(ScalarValue sv) { + if (sv == null) { + return 0L; + } + if (sv.int64_value() != null) { + return sv.int64_value(); + } + if (sv.uint64_value() != null) { + return sv.uint64_value(); + } + return 0L; } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/SparseEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/SparseEncoding.java index 9294a1b0..22e76b6d 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/SparseEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/SparseEncoding.java @@ -1,6 +1,5 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; @@ -13,9 +12,11 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.ShortArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.PatchesMetadata; +import io.github.dfa1.vortex.proto.ScalarValue; +import io.github.dfa1.vortex.proto.SparseMetadata; + +import java.io.IOException; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -83,22 +84,23 @@ private static EncodeResult encode(DType dtype, Object data, EncodeContext ctx) int numPatches = patchIdx.size(); PType idxPtype = chooseIdxPtype(n); - ScalarProtos.ScalarValue fillScalar = zeroScalar(ptype); - byte[] fillBytes = fillScalar.toByteArray(); + ScalarValue fillScalar = zeroScalar(ptype); + byte[] fillBytes = fillScalar.encode(); MemorySegment fillBuf = ctx.arena().allocate(fillBytes.length); MemorySegment.copy(MemorySegment.ofArray(fillBytes), 0, fillBuf, 0, fillBytes.length); MemorySegment idxBuf = buildIdxBuf(patchIdx, idxPtype, numPatches, ctx); MemorySegment valBuf = buildValBuf(patchBits, ptype, numPatches, ctx); - byte[] metaBytes = EncodingProtos.SparseMetadata.newBuilder() - .setPatches(EncodingProtos.PatchesMetadata.newBuilder() - .setLen(numPatches) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.forNumber(idxPtype.ordinal())) - .build()) - .build() - .toByteArray(); + PatchesMetadata patchesMeta = new PatchesMetadata( + numPatches, + 0L, + io.github.dfa1.vortex.proto.PType.fromValue(idxPtype.ordinal()), + null, + null, + null + ); + byte[] metaBytes = new SparseMetadata(patchesMeta).encode(); EncodeNode idxNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); EncodeNode valNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 2); @@ -144,13 +146,12 @@ private static PType chooseIdxPtype(int n) { } } - private static ScalarProtos.ScalarValue zeroScalar(PType ptype) { - ScalarProtos.ScalarValue.Builder b = ScalarProtos.ScalarValue.newBuilder(); + private static ScalarValue zeroScalar(PType ptype) { return switch (ptype) { - case I8, I16, I32, I64 -> b.setInt64Value(0L).build(); - case U8, U16, U32, U64 -> b.setUint64Value(0L).build(); - case F32 -> b.setF32Value(0.0f).build(); - case F64 -> b.setF64Value(0.0).build(); + case I8, I16, I32, I64 -> ScalarValue.ofInt64Value(0L); + case U8, U16, U32, U64 -> ScalarValue.ofUint64Value(0L); + case F32 -> ScalarValue.ofF32Value(0.0f); + case F64 -> ScalarValue.ofF64Value(0.0); default -> throw new VortexException(EncodingId.VORTEX_SPARSE, "unsupported ptype: " + ptype); }; } @@ -181,17 +182,18 @@ private static Array decode(DecodeContext ctx) { if (rawMeta == null || !rawMeta.hasRemaining()) { throw new VortexException(EncodingId.VORTEX_SPARSE, "missing metadata"); } - EncodingProtos.SparseMetadata sparseMeta; + SparseMetadata sparseMeta; try { - sparseMeta = EncodingProtos.SparseMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + sparseMeta = SparseMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_SPARSE, "invalid metadata", e); } - EncodingProtos.PatchesMetadata patches = sparseMeta.getPatches(); - long numPatches = patches.getLen(); - long offset = patches.getOffset(); - PType indicesPtype = ptypeFromProto(patches.getIndicesPtype()); + PatchesMetadata patches = sparseMeta.patches(); + long numPatches = patches.len(); + long offset = patches.offset(); + PType indicesPtype = ptypeFromProto(patches.indices_ptype()); long n = ctx.rowCount(); @@ -209,10 +211,10 @@ private static Array decode(DecodeContext ctx) { PType valuePtype = ((DType.Primitive) ctx.dtype()).ptype(); MemorySegment fillBuf = ctx.buffer(0); - ScalarProtos.ScalarValue fillScalar; + ScalarValue fillScalar; try { - fillScalar = ScalarProtos.ScalarValue.parseFrom(fillBuf.asByteBuffer()); - } catch (InvalidProtocolBufferException e) { + fillScalar = ScalarValue.decode(fillBuf, 0, fillBuf.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_SPARSE, "invalid fill value", e); } @@ -315,7 +317,7 @@ private static long readVarBinOffset(MemorySegment seg, long i, PType ptype) { }; } - private static void fillSegment(MemorySegment out, long n, PType ptype, ScalarProtos.ScalarValue scalar) { + private static void fillSegment(MemorySegment out, long n, PType ptype, ScalarValue scalar) { long fillLong = scalarToLong(scalar); ByteBuffer bb = out.asByteBuffer().order(ByteOrder.LITTLE_ENDIAN); for (long i = 0; i < n; i++) { @@ -373,21 +375,25 @@ private static void writeElem(ByteBuffer bb, PType ptype, long bits) { } } - private static long scalarToLong(ScalarProtos.ScalarValue scalar) { - return switch (scalar.getKindCase()) { - case INT64_VALUE -> scalar.getInt64Value(); - case UINT64_VALUE -> scalar.getUint64Value(); - case F32_VALUE -> Float.floatToRawIntBits(scalar.getF32Value()); - case F64_VALUE -> Double.doubleToRawLongBits(scalar.getF64Value()); - case NULL_VALUE, KIND_NOT_SET -> 0L; - default -> throw new VortexException(EncodingId.VORTEX_SPARSE, - "unexpected scalar kind " + scalar.getKindCase()); - }; + private static long scalarToLong(ScalarValue scalar) { + if (scalar.int64_value() != null) { + return scalar.int64_value(); + } + if (scalar.uint64_value() != null) { + return scalar.uint64_value(); + } + if (scalar.f32_value() != null) { + return Float.floatToRawIntBits(scalar.f32_value()); + } + if (scalar.f64_value() != null) { + return Double.doubleToRawLongBits(scalar.f64_value()); + } + return 0L; } // PType proto enum ordinals match Java PType ordinals (U8=0..F64=10) - private static PType ptypeFromProto(DTypeProtos.PType proto) { - return PType.fromOrdinal(proto.getNumber()); + private static PType ptypeFromProto(io.github.dfa1.vortex.proto.PType proto) { + return PType.fromOrdinal(proto.value()); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/VarBinEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/VarBinEncoding.java index 61fa9290..0029af35 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/VarBinEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/VarBinEncoding.java @@ -1,14 +1,14 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; +import io.github.dfa1.vortex.proto.VarBinMetadata; +import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; @@ -80,10 +80,7 @@ private static EncodeResult encode(Object data, EncodeContext ctx) { offsetsBuf.setAtIndex(PTypeIO.LE_LONG, i + 1, pos); } - byte[] metaBytes = EncodingProtos.VarBinMetadata.newBuilder() - .setOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(PType.I64.ordinal())) - .build() - .toByteArray(); + byte[] metaBytes = new VarBinMetadata(io.github.dfa1.vortex.proto.PType.fromValue(PType.I64.ordinal())).encode(); String minStr = null; String maxStr = null; @@ -98,10 +95,8 @@ private static EncodeResult encode(Object data, EncodeContext ctx) { maxStr = s; } } - byte[] statsMin = minStr != null - ? ScalarProtos.ScalarValue.newBuilder().setStringValue(minStr).build().toByteArray() : null; - byte[] statsMax = maxStr != null - ? ScalarProtos.ScalarValue.newBuilder().setStringValue(maxStr).build().toByteArray() : null; + byte[] statsMin = minStr != null ? ScalarValue.ofStringValue(minStr).encode() : null; + byte[] statsMax = maxStr != null ? ScalarValue.ofStringValue(maxStr).encode() : null; EncodeNode offsetsNode = EncodeNode.leaf(EncodingId.VORTEX_PRIMITIVE, 1); EncodeNode root = new EncodeNode(EncodingId.VORTEX_VARBIN, ByteBuffer.wrap(metaBytes), @@ -117,14 +112,15 @@ private static Array decode(DecodeContext ctx) { if (rawMeta == null) { throw new VortexException(EncodingId.VORTEX_VARBIN, "missing metadata"); } - EncodingProtos.VarBinMetadata meta; + VarBinMetadata meta; try { - meta = EncodingProtos.VarBinMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = VarBinMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_VARBIN, "invalid metadata", e); } - PType offsetsPtype = PType.fromOrdinal(meta.getOffsetsPtype().getNumber()); + PType offsetsPtype = PType.fromOrdinal(meta.offsets_ptype().value()); DType offsetsDtype = new DType.Primitive(offsetsPtype, false); long n = ctx.rowCount(); diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/VariantEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/VariantEncoding.java index c80d1224..42af646d 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/VariantEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/VariantEncoding.java @@ -1,14 +1,14 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.CodedInputStream; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.VariantArray; -import io.github.dfa1.vortex.proto.DTypeProtos; +import io.github.dfa1.vortex.proto.VariantMetadata; import java.io.IOException; +import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; @@ -17,7 +17,7 @@ /// ///

Wire format: ///

    -///
  • Metadata: proto {@code VariantMetadataProto {optional DType shredded_dtype = 1;}}
  • +///
  • Metadata: proto {@code VariantMetadata {optional DType shredded_dtype = 1;}}
  • ///
  • Buffers: none.
  • ///
  • Child 0: {@code core_storage} with the outer variant dtype.
  • ///
  • Child 1 (optional): {@code shredded} with the decoded {@code shredded_dtype}.
  • @@ -74,64 +74,73 @@ private static DType parseShreddedDtype(ByteBuffer rawMeta) { return null; } try { - CodedInputStream cin = CodedInputStream.newInstance(rawMeta.duplicate()); - while (!cin.isAtEnd()) { - int tag = cin.readTag(); - int fieldNumber = tag >>> 3; - if (fieldNumber == 1) { - byte[] dtypeBytes = cin.readByteArray(); - DTypeProtos.DType proto = DTypeProtos.DType.parseFrom(dtypeBytes); - return dtypeFromProto(proto); - } else { - cin.skipField(tag); - } + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + VariantMetadata meta = VariantMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + if (meta.shredded_dtype() == null) { + return null; } + return dtypeFromProto(meta.shredded_dtype()); } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_VARIANT, "invalid metadata", e); } - return null; } - static DType dtypeFromProto(DTypeProtos.DType proto) { - return switch (proto.getDtypeTypeCase()) { - case NULL -> new DType.Null(true); - case BOOL -> new DType.Bool(proto.getBool().getNullable()); - case PRIMITIVE -> new DType.Primitive( - PType.values()[proto.getPrimitive().getType().getNumber()], - proto.getPrimitive().getNullable()); - case DECIMAL -> new DType.Decimal( - (byte) proto.getDecimal().getPrecision(), - (byte) proto.getDecimal().getScale(), - proto.getDecimal().getNullable()); - case UTF8 -> new DType.Utf8(proto.getUtf8().getNullable()); - case BINARY -> new DType.Binary(proto.getBinary().getNullable()); - case STRUCT -> { - var s = proto.getStruct(); - var names = new ArrayList(s.getNamesCount()); - var types = new ArrayList(s.getDtypesCount()); - for (int i = 0; i < s.getNamesCount(); i++) { - names.add(s.getNames(i)); - } - for (DTypeProtos.DType child : s.getDtypesList()) { - types.add(dtypeFromProto(child)); - } - yield new DType.Struct(List.copyOf(names), List.copyOf(types), s.getNullable()); + static DType dtypeFromProto(io.github.dfa1.vortex.proto.DType proto) { + if (proto.null_() != null) { + return new DType.Null(true); + } + if (proto.bool() != null) { + return new DType.Bool(proto.bool().nullable()); + } + if (proto.primitive() != null) { + return new DType.Primitive( + PType.values()[proto.primitive().type().value()], + proto.primitive().nullable()); + } + if (proto.decimal() != null) { + return new DType.Decimal( + (byte) proto.decimal().precision(), + (byte) proto.decimal().scale(), + proto.decimal().nullable()); + } + if (proto.utf8() != null) { + return new DType.Utf8(proto.utf8().nullable()); + } + if (proto.binary() != null) { + return new DType.Binary(proto.binary().nullable()); + } + if (proto.struct() != null) { + var s = proto.struct(); + var names = new ArrayList(s.names().size()); + var types = new ArrayList(s.dtypes().size()); + names.addAll(s.names()); + for (io.github.dfa1.vortex.proto.DType child : s.dtypes()) { + types.add(dtypeFromProto(child)); } - case LIST -> new DType.List( - dtypeFromProto(proto.getList().getElementType()), - proto.getList().getNullable()); - case FIXED_SIZE_LIST -> new DType.FixedSizeList( - dtypeFromProto(proto.getFixedSizeList().getElementType()), - proto.getFixedSizeList().getSize(), - proto.getFixedSizeList().getNullable()); - case EXTENSION -> new DType.Extension( - proto.getExtension().getId(), - dtypeFromProto(proto.getExtension().getStorageDtype()), - proto.getExtension().getMetadata().asReadOnlyByteBuffer(), + return new DType.Struct(List.copyOf(names), List.copyOf(types), s.nullable()); + } + if (proto.list() != null) { + return new DType.List( + dtypeFromProto(proto.list().element_type()), + proto.list().nullable()); + } + if (proto.fixed_size_list() != null) { + return new DType.FixedSizeList( + dtypeFromProto(proto.fixed_size_list().element_type()), + proto.fixed_size_list().size(), + proto.fixed_size_list().nullable()); + } + if (proto.extension() != null) { + return new DType.Extension( + proto.extension().id(), + dtypeFromProto(proto.extension().storage_dtype()), + ByteBuffer.wrap(proto.extension().metadata() != null ? proto.extension().metadata() : new byte[0]).asReadOnlyBuffer(), false); - case VARIANT -> new DType.Variant(proto.getVariant().getNullable()); - default -> throw new VortexException("unsupported proto DType: " + proto.getDtypeTypeCase()); - }; + } + if (proto.variant() != null) { + return new DType.Variant(proto.variant().nullable()); + } + throw new VortexException("unsupported proto DType"); } } } diff --git a/core/src/main/java/io/github/dfa1/vortex/encoding/ZstdEncoding.java b/core/src/main/java/io/github/dfa1/vortex/encoding/ZstdEncoding.java index 0e4c3e11..19baa539 100644 --- a/core/src/main/java/io/github/dfa1/vortex/encoding/ZstdEncoding.java +++ b/core/src/main/java/io/github/dfa1/vortex/encoding/ZstdEncoding.java @@ -1,7 +1,6 @@ package io.github.dfa1.vortex.encoding; import com.github.luben.zstd.ZstdDecompressCtx; -import com.google.protobuf.InvalidProtocolBufferException; import io.airlift.compress.v3.zstd.ZstdCompressor; import io.airlift.compress.v3.zstd.ZstdDecompressor; import io.airlift.compress.v3.zstd.ZstdJavaCompressor; @@ -20,8 +19,10 @@ import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.ShortArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.ZstdFrameMetadata; +import io.github.dfa1.vortex.proto.ZstdMetadata; +import java.io.IOException; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -105,12 +106,10 @@ private static EncodeResult encodeVarBin(String[] strings) { private static EncodeResult buildResult(byte[] raw, long n) { byte[] compressed = compress(raw); - byte[] meta = EncodingProtos.ZstdMetadata.newBuilder() - .setDictionarySize(0) - .addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(raw.length) - .setNValues(n)) - .build().toByteArray(); + byte[] meta = new ZstdMetadata( + 0, + java.util.List.of(new ZstdFrameMetadata(raw.length, n)) + ).encode(); EncodeNode root = new EncodeNode(EncodingId.VORTEX_ZSTD, ByteBuffer.wrap(meta), new EncodeNode[0], new int[]{0}); return new EncodeResult(root, List.of(MemorySegment.ofArray(compressed)), null, null); @@ -208,13 +207,14 @@ private static Array decode(DecodeContext ctx) { if (rawMeta == null) { throw new VortexException(EncodingId.VORTEX_ZSTD, "missing metadata"); } - EncodingProtos.ZstdMetadata meta; + ZstdMetadata meta; try { - meta = EncodingProtos.ZstdMetadata.parseFrom(rawMeta.duplicate()); - } catch (InvalidProtocolBufferException e) { + MemorySegment metaSeg = MemorySegment.ofBuffer(rawMeta.duplicate()); + meta = ZstdMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + } catch (IOException e) { throw new VortexException(EncodingId.VORTEX_ZSTD, "invalid metadata", e); } - boolean hasDictionary = meta.getDictionarySize() != 0; + boolean hasDictionary = meta.dictionary_size() != 0; BoolArray validity = null; if (ctx.node().children().length > 0) { @@ -226,10 +226,10 @@ private static Array decode(DecodeContext ctx) { validity = ba; } - int frameCount = meta.getFramesCount(); + int frameCount = meta.frames().size(); long totalUncompressed = 0; for (int i = 0; i < frameCount; i++) { - totalUncompressed += meta.getFrames(i).getUncompressedSize(); + totalUncompressed += meta.frames().get(i).uncompressed_size(); } MemorySegment decompressed = hasDictionary @@ -309,7 +309,7 @@ private static VarBinArray buildScatteredVarBin( private static MemorySegment decompressFramesWithDict( DecodeContext ctx, - EncodingProtos.ZstdMetadata meta, + ZstdMetadata meta, int frameCount, long totalUncompressed ) { @@ -320,7 +320,7 @@ private static MemorySegment decompressFramesWithDict( long outOffset = 0; for (int i = 0; i < frameCount; i++) { byte[] compressed = ctx.buffer(i + 1).toArray(ValueLayout.JAVA_BYTE); - int uncompSize = (int) meta.getFrames(i).getUncompressedSize(); + int uncompSize = (int) meta.frames().get(i).uncompressed_size(); byte[] temp = new byte[uncompSize]; int written = zctx.decompressByteArray(temp, 0, uncompSize, compressed, 0, compressed.length); if (written != uncompSize) { @@ -340,7 +340,7 @@ private static MemorySegment decompressFramesWithDict( private static MemorySegment decompressFrames( DecodeContext ctx, - EncodingProtos.ZstdMetadata meta, + ZstdMetadata meta, int frameCount, long totalUncompressed ) { @@ -350,7 +350,7 @@ private static MemorySegment decompressFrames( for (int i = 0; i < frameCount; i++) { MemorySegment frameSeg = ctx.buffer(i); byte[] compressed = frameSeg.toArray(ValueLayout.JAVA_BYTE); - int uncompSize = (int) meta.getFrames(i).getUncompressedSize(); + int uncompSize = (int) meta.frames().get(i).uncompressed_size(); byte[] temp = new byte[uncompSize]; int written = decompressor.decompress(compressed, 0, compressed.length, temp, 0, uncompSize); if (written != uncompSize) { diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ALPMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ALPMetadata.java new file mode 100644 index 00000000..be91f9df --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ALPMetadata.java @@ -0,0 +1,67 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ALPMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param exp_e field tag 1 +/// @param exp_f field tag 2 +/// @param patches field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ALPMetadata( + int exp_e, + int exp_f, + PatchesMetadata patches +) { + + /// Decodes a {@code vortex.encodings.ALPMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ALPMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int exp_e = 0; + int exp_f = 0; + PatchesMetadata patches = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + exp_e = r.readVarint32(); + } + case 2 -> { + exp_f = r.readVarint32(); + } + case 3 -> { + MemorySegment __slice = r.readLenDelimSegment(); + patches = PatchesMetadata.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new ALPMetadata(exp_e, exp_f, patches); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (exp_e != 0) { + w.writeTag(1, 0); + w.writeVarint32(exp_e); + } + if (exp_f != 0) { + w.writeTag(2, 0); + w.writeVarint32(exp_f); + } + if (patches != null) { + w.writeTag(3, 2); + w.writeEmbedded(patches.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ALPRDMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ALPRDMetadata.java new file mode 100644 index 00000000..b0a8620d --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ALPRDMetadata.java @@ -0,0 +1,104 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ALPRDMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param right_bit_width field tag 1 +/// @param dict_len field tag 2 +/// @param dict field tag 3 +/// @param left_parts_ptype field tag 4 +/// @param patches field tag 5 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ALPRDMetadata( + int right_bit_width, + int dict_len, + java.util.List dict, + PType left_parts_ptype, + PatchesMetadata patches +) { + + /// Decodes a {@code vortex.encodings.ALPRDMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ALPRDMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int right_bit_width = 0; + int dict_len = 0; + java.util.List dict = new java.util.ArrayList<>(); + PType left_parts_ptype = PType.U8; + PatchesMetadata patches = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + right_bit_width = r.readVarint32(); + } + case 2 -> { + dict_len = r.readVarint32(); + } + case 3 -> { + int wt = tag & 7; + if (wt == 2) { + int len = r.readVarint32(); + java.util.List __target = dict; + r.readPacked(len, reader -> __target.add(reader.readVarint32())); + } else { + dict.add(r.readVarint32()); + } + } + case 4 -> { + int __ev = r.readVarint32(); + try { + left_parts_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 5 -> { + MemorySegment __slice = r.readLenDelimSegment(); + patches = PatchesMetadata.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new ALPRDMetadata(right_bit_width, dict_len, dict, left_parts_ptype, patches); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (right_bit_width != 0) { + w.writeTag(1, 0); + w.writeVarint32(right_bit_width); + } + if (dict_len != 0) { + w.writeTag(2, 0); + w.writeVarint32(dict_len); + } + if (!dict.isEmpty()) { + ProtoWriter packed = new ProtoWriter(); + for (Integer __v : dict) { + packed.writeVarint32(__v); + } + byte[] __bytes = packed.toByteArray(); + w.writeTag(3, 2); + w.writeEmbedded(__bytes); + } + if (left_parts_ptype.value() != 0) { + w.writeTag(4, 0); + w.writeVarint32(left_parts_ptype.value()); + } + if (patches != null) { + w.writeTag(5, 2); + w.writeEmbedded(patches.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Binary.java b/core/src/main/java/io/github/dfa1/vortex/proto/Binary.java new file mode 100644 index 00000000..06b86bb7 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Binary.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Binary}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param nullable field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Binary( + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Binary} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Binary decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Binary(nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (nullable) { + w.writeTag(1, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/BitPackedMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/BitPackedMetadata.java new file mode 100644 index 00000000..85a8f155 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/BitPackedMetadata.java @@ -0,0 +1,67 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.BitPackedMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param bit_width field tag 1 +/// @param offset field tag 2 +/// @param patches field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record BitPackedMetadata( + int bit_width, + int offset, + PatchesMetadata patches +) { + + /// Decodes a {@code vortex.encodings.BitPackedMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static BitPackedMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int bit_width = 0; + int offset = 0; + PatchesMetadata patches = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + bit_width = r.readVarint32(); + } + case 2 -> { + offset = r.readVarint32(); + } + case 3 -> { + MemorySegment __slice = r.readLenDelimSegment(); + patches = PatchesMetadata.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new BitPackedMetadata(bit_width, offset, patches); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (bit_width != 0) { + w.writeTag(1, 0); + w.writeVarint32(bit_width); + } + if (offset != 0) { + w.writeTag(2, 0); + w.writeVarint32(offset); + } + if (patches != null) { + w.writeTag(3, 2); + w.writeEmbedded(patches.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Bool.java b/core/src/main/java/io/github/dfa1/vortex/proto/Bool.java new file mode 100644 index 00000000..a6157e18 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Bool.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Bool}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param nullable field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Bool( + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Bool} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Bool decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Bool(nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (nullable) { + w.writeTag(1, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DType.java b/core/src/main/java/io/github/dfa1/vortex/proto/DType.java new file mode 100644 index 00000000..031440f9 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DType.java @@ -0,0 +1,252 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.DType}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param null_ field tag 1 +/// @param bool field tag 2 +/// @param primitive field tag 3 +/// @param decimal field tag 4 +/// @param utf8 field tag 5 +/// @param binary field tag 6 +/// @param struct field tag 7 +/// @param list field tag 8 +/// @param extension field tag 9 +/// @param fixed_size_list field tag 10 +/// @param variant field tag 11 +/// @param union field tag 12 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DType( + Null null_, + Bool bool, + Primitive primitive, + Decimal decimal, + Utf8 utf8, + Binary binary, + Struct struct, + List list, + Extension extension, + FixedSizeList fixed_size_list, + Variant variant, + Union union +) { + + /// Decodes a {@code vortex.dtype.DType} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DType decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + Null null_ = null; + Bool bool = null; + Primitive primitive = null; + Decimal decimal = null; + Utf8 utf8 = null; + Binary binary = null; + Struct struct = null; + List list = null; + Extension extension = null; + FixedSizeList fixed_size_list = null; + Variant variant = null; + Union union = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + null_ = Null.decode(__slice, 0, __slice.byteSize()); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + bool = Bool.decode(__slice, 0, __slice.byteSize()); + } + case 3 -> { + MemorySegment __slice = r.readLenDelimSegment(); + primitive = Primitive.decode(__slice, 0, __slice.byteSize()); + } + case 4 -> { + MemorySegment __slice = r.readLenDelimSegment(); + decimal = Decimal.decode(__slice, 0, __slice.byteSize()); + } + case 5 -> { + MemorySegment __slice = r.readLenDelimSegment(); + utf8 = Utf8.decode(__slice, 0, __slice.byteSize()); + } + case 6 -> { + MemorySegment __slice = r.readLenDelimSegment(); + binary = Binary.decode(__slice, 0, __slice.byteSize()); + } + case 7 -> { + MemorySegment __slice = r.readLenDelimSegment(); + struct = Struct.decode(__slice, 0, __slice.byteSize()); + } + case 8 -> { + MemorySegment __slice = r.readLenDelimSegment(); + list = List.decode(__slice, 0, __slice.byteSize()); + } + case 9 -> { + MemorySegment __slice = r.readLenDelimSegment(); + extension = Extension.decode(__slice, 0, __slice.byteSize()); + } + case 10 -> { + MemorySegment __slice = r.readLenDelimSegment(); + fixed_size_list = FixedSizeList.decode(__slice, 0, __slice.byteSize()); + } + case 11 -> { + MemorySegment __slice = r.readLenDelimSegment(); + variant = Variant.decode(__slice, 0, __slice.byteSize()); + } + case 12 -> { + MemorySegment __slice = r.readLenDelimSegment(); + union = Union.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new DType(null_, bool, primitive, decimal, utf8, binary, struct, list, extension, fixed_size_list, variant, union); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (null_ != null) { + w.writeTag(1, 2); + w.writeEmbedded(null_.encode()); + } + if (bool != null) { + w.writeTag(2, 2); + w.writeEmbedded(bool.encode()); + } + if (primitive != null) { + w.writeTag(3, 2); + w.writeEmbedded(primitive.encode()); + } + if (decimal != null) { + w.writeTag(4, 2); + w.writeEmbedded(decimal.encode()); + } + if (utf8 != null) { + w.writeTag(5, 2); + w.writeEmbedded(utf8.encode()); + } + if (binary != null) { + w.writeTag(6, 2); + w.writeEmbedded(binary.encode()); + } + if (struct != null) { + w.writeTag(7, 2); + w.writeEmbedded(struct.encode()); + } + if (list != null) { + w.writeTag(8, 2); + w.writeEmbedded(list.encode()); + } + if (extension != null) { + w.writeTag(9, 2); + w.writeEmbedded(extension.encode()); + } + if (fixed_size_list != null) { + w.writeTag(10, 2); + w.writeEmbedded(fixed_size_list.encode()); + } + if (variant != null) { + w.writeTag(11, 2); + w.writeEmbedded(variant.encode()); + } + if (union != null) { + w.writeTag(12, 2); + w.writeEmbedded(union.encode()); + } + return w.toByteArray(); + } + + /// Factory for oneof case {@code null} (field tag 1). + /// @param value the value to set + /// @return a record with only the {@code null} component set + public static DType ofNull(Null value) { + return new DType(value, null, null, null, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code bool} (field tag 2). + /// @param value the value to set + /// @return a record with only the {@code bool} component set + public static DType ofBool(Bool value) { + return new DType(null, value, null, null, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code primitive} (field tag 3). + /// @param value the value to set + /// @return a record with only the {@code primitive} component set + public static DType ofPrimitive(Primitive value) { + return new DType(null, null, value, null, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code decimal} (field tag 4). + /// @param value the value to set + /// @return a record with only the {@code decimal} component set + public static DType ofDecimal(Decimal value) { + return new DType(null, null, null, value, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code utf8} (field tag 5). + /// @param value the value to set + /// @return a record with only the {@code utf8} component set + public static DType ofUtf8(Utf8 value) { + return new DType(null, null, null, null, value, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code binary} (field tag 6). + /// @param value the value to set + /// @return a record with only the {@code binary} component set + public static DType ofBinary(Binary value) { + return new DType(null, null, null, null, null, value, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code struct} (field tag 7). + /// @param value the value to set + /// @return a record with only the {@code struct} component set + public static DType ofStruct(Struct value) { + return new DType(null, null, null, null, null, null, value, null, null, null, null, null); + } + + /// Factory for oneof case {@code list} (field tag 8). + /// @param value the value to set + /// @return a record with only the {@code list} component set + public static DType ofList(List value) { + return new DType(null, null, null, null, null, null, null, value, null, null, null, null); + } + + /// Factory for oneof case {@code extension} (field tag 9). + /// @param value the value to set + /// @return a record with only the {@code extension} component set + public static DType ofExtension(Extension value) { + return new DType(null, null, null, null, null, null, null, null, value, null, null, null); + } + + /// Factory for oneof case {@code fixed_size_list} (field tag 10). + /// @param value the value to set + /// @return a record with only the {@code fixed_size_list} component set + public static DType ofFixedSizeList(FixedSizeList value) { + return new DType(null, null, null, null, null, null, null, null, null, value, null, null); + } + + /// Factory for oneof case {@code variant} (field tag 11). + /// @param value the value to set + /// @return a record with only the {@code variant} component set + public static DType ofVariant(Variant value) { + return new DType(null, null, null, null, null, null, null, null, null, null, value, null); + } + + /// Factory for oneof case {@code union} (field tag 12). + /// @param value the value to set + /// @return a record with only the {@code union} component set + public static DType ofUnion(Union value) { + return new DType(null, null, null, null, null, null, null, null, null, null, null, value); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DTypeProtos.java b/core/src/main/java/io/github/dfa1/vortex/proto/DTypeProtos.java deleted file mode 100644 index a6f22239..00000000 --- a/core/src/main/java/io/github/dfa1/vortex/proto/DTypeProtos.java +++ /dev/null @@ -1,13153 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: dtype.proto -// Protobuf Java Version: 4.35.0 - -package io.github.dfa1.vortex.proto; - -@com.google.protobuf.Generated -public final class DTypeProtos extends com.google.protobuf.GeneratedFile { - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Null_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Null_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Bool_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Bool_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Primitive_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Primitive_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Decimal_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Decimal_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Utf8_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Utf8_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Binary_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Binary_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Struct_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Struct_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_List_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_List_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_FixedSizeList_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_FixedSizeList_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Extension_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Extension_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Variant_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Variant_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Union_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Union_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_DType_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_DType_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_Field_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_Field_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_dtype_FieldPath_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_dtype_FieldPath_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.FileDescriptor - descriptor; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DTypeProtos"); - } - - static { - java.lang.String[] descriptorData = { - "\n\013dtype.proto\022\014vortex.dtype\"\006\n\004Null\"\030\n\004B" + - "ool\022\020\n\010nullable\030\001 \001(\010\"@\n\tPrimitive\022!\n\004ty" + - "pe\030\001 \001(\0162\023.vortex.dtype.PType\022\020\n\010nullabl" + - "e\030\002 \001(\010\"=\n\007Decimal\022\021\n\tprecision\030\001 \001(\r\022\r\n" + - "\005scale\030\002 \001(\005\022\020\n\010nullable\030\003 \001(\010\"\030\n\004Utf8\022\020" + - "\n\010nullable\030\001 \001(\010\"\032\n\006Binary\022\020\n\010nullable\030\001" + - " \001(\010\"N\n\006Struct\022\r\n\005names\030\001 \003(\t\022#\n\006dtypes\030" + - "\002 \003(\0132\023.vortex.dtype.DType\022\020\n\010nullable\030\003" + - " \001(\010\"C\n\004List\022)\n\014element_type\030\001 \001(\0132\023.vor" + - "tex.dtype.DType\022\020\n\010nullable\030\002 \001(\010\"Z\n\rFix" + - "edSizeList\022)\n\014element_type\030\001 \001(\0132\023.vorte" + - "x.dtype.DType\022\014\n\004size\030\002 \001(\r\022\020\n\010nullable\030" + - "\003 \001(\010\"g\n\tExtension\022\n\n\002id\030\001 \001(\t\022*\n\rstorag" + - "e_dtype\030\002 \001(\0132\023.vortex.dtype.DType\022\025\n\010me" + - "tadata\030\003 \001(\014H\000\210\001\001B\013\n\t_metadata\"\033\n\007Varian" + - "t\022\020\n\010nullable\030\001 \001(\010\"\031\n\005Union\022\020\n\010nullable" + - "\030\004 \001(\010\"\203\004\n\005DType\022\"\n\004null\030\001 \001(\0132\022.vortex." + - "dtype.NullH\000\022\"\n\004bool\030\002 \001(\0132\022.vortex.dtyp" + - "e.BoolH\000\022,\n\tprimitive\030\003 \001(\0132\027.vortex.dty" + - "pe.PrimitiveH\000\022(\n\007decimal\030\004 \001(\0132\025.vortex" + - ".dtype.DecimalH\000\022\"\n\004utf8\030\005 \001(\0132\022.vortex." + - "dtype.Utf8H\000\022&\n\006binary\030\006 \001(\0132\024.vortex.dt" + - "ype.BinaryH\000\022&\n\006struct\030\007 \001(\0132\024.vortex.dt" + - "ype.StructH\000\022\"\n\004list\030\010 \001(\0132\022.vortex.dtyp" + - "e.ListH\000\022,\n\textension\030\t \001(\0132\027.vortex.dty" + - "pe.ExtensionH\000\0226\n\017fixed_size_list\030\n \001(\0132" + - "\033.vortex.dtype.FixedSizeListH\000\022(\n\007varian" + - "t\030\013 \001(\0132\025.vortex.dtype.VariantH\000\022$\n\005unio" + - "n\030\014 \001(\0132\023.vortex.dtype.UnionH\000B\014\n\ndtype_" + - "type\"%\n\005Field\022\016\n\004name\030\001 \001(\tH\000B\014\n\nfield_t" + - "ype\".\n\tFieldPath\022!\n\004path\030\001 \003(\0132\023.vortex." + - "dtype.Field*h\n\005PType\022\006\n\002U8\020\000\022\007\n\003U16\020\001\022\007\n" + - "\003U32\020\002\022\007\n\003U64\020\003\022\006\n\002I8\020\004\022\007\n\003I16\020\005\022\007\n\003I32\020" + - "\006\022\007\n\003I64\020\007\022\007\n\003F16\020\010\022\007\n\003F32\020\t\022\007\n\003F64\020\nB*\n" + - "\033io.github.dfa1.vortex.protoB\013DTypeProto" + - "sb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - }); - internal_static_vortex_dtype_Null_descriptor = - getDescriptor().getMessageType(0); - internal_static_vortex_dtype_Null_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Null_descriptor, - new java.lang.String[]{}); - internal_static_vortex_dtype_Bool_descriptor = - getDescriptor().getMessageType(1); - internal_static_vortex_dtype_Bool_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Bool_descriptor, - new java.lang.String[]{"Nullable",}); - internal_static_vortex_dtype_Primitive_descriptor = - getDescriptor().getMessageType(2); - internal_static_vortex_dtype_Primitive_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Primitive_descriptor, - new java.lang.String[]{"Type", "Nullable",}); - internal_static_vortex_dtype_Decimal_descriptor = - getDescriptor().getMessageType(3); - internal_static_vortex_dtype_Decimal_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Decimal_descriptor, - new java.lang.String[]{"Precision", "Scale", "Nullable",}); - internal_static_vortex_dtype_Utf8_descriptor = - getDescriptor().getMessageType(4); - internal_static_vortex_dtype_Utf8_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Utf8_descriptor, - new java.lang.String[]{"Nullable",}); - internal_static_vortex_dtype_Binary_descriptor = - getDescriptor().getMessageType(5); - internal_static_vortex_dtype_Binary_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Binary_descriptor, - new java.lang.String[]{"Nullable",}); - internal_static_vortex_dtype_Struct_descriptor = - getDescriptor().getMessageType(6); - internal_static_vortex_dtype_Struct_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Struct_descriptor, - new java.lang.String[]{"Names", "Dtypes", "Nullable",}); - internal_static_vortex_dtype_List_descriptor = - getDescriptor().getMessageType(7); - internal_static_vortex_dtype_List_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_List_descriptor, - new java.lang.String[]{"ElementType", "Nullable",}); - internal_static_vortex_dtype_FixedSizeList_descriptor = - getDescriptor().getMessageType(8); - internal_static_vortex_dtype_FixedSizeList_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_FixedSizeList_descriptor, - new java.lang.String[]{"ElementType", "Size", "Nullable",}); - internal_static_vortex_dtype_Extension_descriptor = - getDescriptor().getMessageType(9); - internal_static_vortex_dtype_Extension_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Extension_descriptor, - new java.lang.String[]{"Id", "StorageDtype", "Metadata",}); - internal_static_vortex_dtype_Variant_descriptor = - getDescriptor().getMessageType(10); - internal_static_vortex_dtype_Variant_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Variant_descriptor, - new java.lang.String[]{"Nullable",}); - internal_static_vortex_dtype_Union_descriptor = - getDescriptor().getMessageType(11); - internal_static_vortex_dtype_Union_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Union_descriptor, - new java.lang.String[]{"Nullable",}); - internal_static_vortex_dtype_DType_descriptor = - getDescriptor().getMessageType(12); - internal_static_vortex_dtype_DType_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_DType_descriptor, - new java.lang.String[]{"Null", "Bool", "Primitive", "Decimal", "Utf8", "Binary", "Struct", "List", "Extension", "FixedSizeList", "Variant", "Union", "DtypeType",}); - internal_static_vortex_dtype_Field_descriptor = - getDescriptor().getMessageType(13); - internal_static_vortex_dtype_Field_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_Field_descriptor, - new java.lang.String[]{"Name", "FieldType",}); - internal_static_vortex_dtype_FieldPath_descriptor = - getDescriptor().getMessageType(14); - internal_static_vortex_dtype_FieldPath_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_dtype_FieldPath_descriptor, - new java.lang.String[]{"Path",}); - descriptor.resolveAllFeaturesImmutable(); - } - - private DTypeProtos() { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - - /** - * Protobuf enum {@code vortex.dtype.PType} - */ - public enum PType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * U8 = 0; - */ - U8(0), - /** - * U16 = 1; - */ - U16(1), - /** - * U32 = 2; - */ - U32(2), - /** - * U64 = 3; - */ - U64(3), - /** - * I8 = 4; - */ - I8(4), - /** - * I16 = 5; - */ - I16(5), - /** - * I32 = 6; - */ - I32(6), - /** - * I64 = 7; - */ - I64(7), - /** - * F16 = 8; - */ - F16(8), - /** - * F32 = 9; - */ - F32(9), - /** - * F64 = 10; - */ - F64(10), - UNRECOGNIZED(-1), - ; - - /** - * U8 = 0; - */ - public static final int U8_VALUE = 0; - /** - * U16 = 1; - */ - public static final int U16_VALUE = 1; - /** - * U32 = 2; - */ - public static final int U32_VALUE = 2; - /** - * U64 = 3; - */ - public static final int U64_VALUE = 3; - /** - * I8 = 4; - */ - public static final int I8_VALUE = 4; - /** - * I16 = 5; - */ - public static final int I16_VALUE = 5; - /** - * I32 = 6; - */ - public static final int I32_VALUE = 6; - /** - * I64 = 7; - */ - public static final int I64_VALUE = 7; - /** - * F16 = 8; - */ - public static final int F16_VALUE = 8; - /** - * F32 = 9; - */ - public static final int F32_VALUE = 9; - /** - * F64 = 10; - */ - public static final int F64_VALUE = 10; - private static final com.google.protobuf.Internal.EnumLiteMap< - PType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public PType findValueByNumber(int number) { - return PType.forNumber(number); - } - }; - private static final PType[] VALUES = values(); - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "PType"); - } - - private final int value; - - private PType(int value) { - this.value = value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static PType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static PType forNumber(int value) { - switch (value) { - case 0: - return U8; - case 1: - return U16; - case 2: - return U32; - case 3: - return U64; - case 4: - return I8; - case 5: - return I16; - case 6: - return I32; - case 7: - return I64; - case 8: - return F16; - case 9: - return F32; - case 10: - return F64; - default: - return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - - public static com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.getDescriptor().getEnumType(0); - } - - public static PType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValue(ordinal()); - } - - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - - // @@protoc_insertion_point(enum_scope:vortex.dtype.PType) - } - - public interface NullOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Null) - com.google.protobuf.MessageOrBuilder { - } - - public interface BoolOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Bool) - com.google.protobuf.MessageOrBuilder { - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface PrimitiveOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Primitive) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - - /** - * .vortex.dtype.PType type = 1; - * - * @return The type. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getType(); - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface DecimalOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Decimal) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 precision = 1; - * - * @return The precision. - */ - int getPrecision(); - - /** - * int32 scale = 2; - * - * @return The scale. - */ - int getScale(); - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface Utf8OrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Utf8) - com.google.protobuf.MessageOrBuilder { - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface BinaryOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Binary) - com.google.protobuf.MessageOrBuilder { - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface StructOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Struct) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated string names = 1; - * - * @return A list containing the names. - */ - java.util.List - getNamesList(); - - /** - * repeated string names = 1; - * - * @return The count of names. - */ - int getNamesCount(); - - /** - * repeated string names = 1; - * - * @param index The index of the element to return. - * @return The names at the given index. - */ - java.lang.String getNames(int index); - - /** - * repeated string names = 1; - * - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - com.google.protobuf.ByteString - getNamesBytes(int index); - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - java.util.List - getDtypesList(); - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DType getDtypes(int index); - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - int getDtypesCount(); - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - java.util.List - getDtypesOrBuilderList(); - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypesOrBuilder( - int index); - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface ListOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.List) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - boolean hasElementType(); - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType(); - - /** - * .vortex.dtype.DType element_type = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder(); - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface FixedSizeListOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.FixedSizeList) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - boolean hasElementType(); - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType(); - - /** - * .vortex.dtype.DType element_type = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder(); - - /** - * uint32 size = 2; - * - * @return The size. - */ - int getSize(); - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface ExtensionOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Extension) - com.google.protobuf.MessageOrBuilder { - - /** - * string id = 1; - * - * @return The id. - */ - java.lang.String getId(); - - /** - * string id = 1; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString - getIdBytes(); - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return Whether the storageDtype field is set. - */ - boolean hasStorageDtype(); - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return The storageDtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.DType getStorageDtype(); - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getStorageDtypeOrBuilder(); - - /** - * optional bytes metadata = 3; - * - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - - /** - * optional bytes metadata = 3; - * - * @return The metadata. - */ - com.google.protobuf.ByteString getMetadata(); - } - - public interface VariantOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Variant) - com.google.protobuf.MessageOrBuilder { - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface UnionOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Union) - com.google.protobuf.MessageOrBuilder { - - /** - * bool nullable = 4; - * - * @return The nullable. - */ - boolean getNullable(); - } - - public interface DTypeOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.DType) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.Null null = 1; - * - * @return Whether the null field is set. - */ - boolean hasNull(); - - /** - * .vortex.dtype.Null null = 1; - * - * @return The null. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Null getNull(); - - /** - * .vortex.dtype.Null null = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder getNullOrBuilder(); - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return Whether the bool field is set. - */ - boolean hasBool(); - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return The bool. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Bool getBool(); - - /** - * .vortex.dtype.Bool bool = 2; - */ - io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder getBoolOrBuilder(); - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return Whether the primitive field is set. - */ - boolean hasPrimitive(); - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return The primitive. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Primitive getPrimitive(); - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder getPrimitiveOrBuilder(); - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return Whether the decimal field is set. - */ - boolean hasDecimal(); - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return The decimal. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDecimal(); - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder getDecimalOrBuilder(); - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return Whether the utf8 field is set. - */ - boolean hasUtf8(); - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return The utf8. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getUtf8(); - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder getUtf8OrBuilder(); - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return Whether the binary field is set. - */ - boolean hasBinary(); - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return The binary. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Binary getBinary(); - - /** - * .vortex.dtype.Binary binary = 6; - */ - io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder getBinaryOrBuilder(); - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return Whether the struct field is set. - */ - boolean hasStruct(); - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return The struct. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Struct getStruct(); - - /** - * .vortex.dtype.Struct struct = 7; - */ - io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder getStructOrBuilder(); - - /** - * .vortex.dtype.List list = 8; - * - * @return Whether the list field is set. - */ - boolean hasList(); - - /** - * .vortex.dtype.List list = 8; - * - * @return The list. - */ - io.github.dfa1.vortex.proto.DTypeProtos.List getList(); - - /** - * .vortex.dtype.List list = 8; - */ - io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder getListOrBuilder(); - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return Whether the extension field is set. - */ - boolean hasExtension(); - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return The extension. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Extension getExtension(); - - /** - * .vortex.dtype.Extension extension = 9; - */ - io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder getExtensionOrBuilder(); - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return Whether the fixedSizeList field is set. - */ - boolean hasFixedSizeList(); - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return The fixedSizeList. - */ - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getFixedSizeList(); - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder getFixedSizeListOrBuilder(); - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return Whether the variant field is set. - */ - boolean hasVariant(); - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return The variant. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Variant getVariant(); - - /** - * .vortex.dtype.Variant variant = 11; - */ - io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder getVariantOrBuilder(); - - /** - * .vortex.dtype.Union union = 12; - * - * @return Whether the union field is set. - */ - boolean hasUnion(); - - /** - * .vortex.dtype.Union union = 12; - * - * @return The union. - */ - io.github.dfa1.vortex.proto.DTypeProtos.Union getUnion(); - - /** - * .vortex.dtype.Union union = 12; - */ - io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder getUnionOrBuilder(); - - io.github.dfa1.vortex.proto.DTypeProtos.DType.DtypeTypeCase getDtypeTypeCase(); - } - - public interface FieldOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.Field) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * - * @return Whether the name field is set. - */ - boolean hasName(); - - /** - * string name = 1; - * - * @return The name. - */ - java.lang.String getName(); - - /** - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - io.github.dfa1.vortex.proto.DTypeProtos.Field.FieldTypeCase getFieldTypeCase(); - } - - public interface FieldPathOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.dtype.FieldPath) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .vortex.dtype.Field path = 1; - */ - java.util.List - getPathList(); - - /** - * repeated .vortex.dtype.Field path = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.Field getPath(int index); - - /** - * repeated .vortex.dtype.Field path = 1; - */ - int getPathCount(); - - /** - * repeated .vortex.dtype.Field path = 1; - */ - java.util.List - getPathOrBuilderList(); - - /** - * repeated .vortex.dtype.Field path = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder getPathOrBuilder( - int index); - } - - /** - * Protobuf type {@code vortex.dtype.Null} - */ - public static final class Null extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Null) - NullOrBuilder { - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Null) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Null DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Null parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Null"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Null(); - } - - private byte memoizedIsInitialized = -1; - - // Use Null.newBuilder() to construct. - private Null(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Null() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Null prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Null getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Null.class, io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder.class); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getUnknownFields().writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Null)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Null other = (io.github.dfa1.vortex.proto.DTypeProtos.Null) obj; - - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Null} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Null) - io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder { - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Null.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Null.class, io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Null_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null build() { - io.github.dfa1.vortex.proto.DTypeProtos.Null result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Null result = new io.github.dfa1.vortex.proto.DTypeProtos.Null(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Null) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Null) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Null other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance()) { - return this; - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Null) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Bool} - */ - public static final class Bool extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Bool) - BoolOrBuilder { - public static final int NULLABLE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Bool) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Bool DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Bool parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Bool"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Bool(); - } - - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Bool.newBuilder() to construct. - private Bool(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Bool() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Bool prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Bool getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Bool.class, io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder.class); - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nullable_ != false) { - output.writeBool(1, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Bool)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Bool other = (io.github.dfa1.vortex.proto.DTypeProtos.Bool) obj; - - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Bool} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Bool) - io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder { - private int bitField0_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Bool.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Bool.class, io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Bool_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool build() { - io.github.dfa1.vortex.proto.DTypeProtos.Bool result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Bool result = new io.github.dfa1.vortex.proto.DTypeProtos.Bool(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Bool result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Bool) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Bool) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Bool other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance()) { - return this; - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 1; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bool nullable = 1; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Bool) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Primitive} - */ - public static final class Primitive extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Primitive) - PrimitiveOrBuilder { - public static final int TYPE_FIELD_NUMBER = 1; - public static final int NULLABLE_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Primitive) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Primitive DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Primitive parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Primitive"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Primitive(); - } - - private int type_ = 0; - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Primitive.newBuilder() to construct. - private Primitive(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Primitive() { - type_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Primitive prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Primitive getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Primitive.class, io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder.class); - } - - /** - * .vortex.dtype.PType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return type_; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @return The type. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getType() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(type_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (type_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, type_); - } - if (nullable_ != false) { - output.writeBool(2, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (type_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, type_); - } - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Primitive)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Primitive other = (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) obj; - - if (type_ != other.type_) { - return false; - } - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Primitive} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Primitive) - io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder { - private int bitField0_; - private int type_ = 0; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Primitive.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Primitive.class, io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - type_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Primitive_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive build() { - io.github.dfa1.vortex.proto.DTypeProtos.Primitive result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Primitive result = new io.github.dfa1.vortex.proto.DTypeProtos.Primitive(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Primitive result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.type_ = type_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Primitive) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Primitive) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Primitive other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance()) { - return this; - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - type_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - @java.lang.Override - public int getTypeValue() { - return type_; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - type_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @return The type. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getType() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(type_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @param value The type to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setType(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - type_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType type = 1; - * - * @return This builder for chaining. - */ - public Builder clearType() { - bitField0_ = (bitField0_ & ~0x00000001); - type_ = 0; - onChanged(); - return this; - } - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 2; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * bool nullable = 2; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000002); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Primitive) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Decimal} - */ - public static final class Decimal extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Decimal) - DecimalOrBuilder { - public static final int PRECISION_FIELD_NUMBER = 1; - public static final int SCALE_FIELD_NUMBER = 2; - public static final int NULLABLE_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Decimal) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Decimal DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Decimal parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Decimal"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Decimal(); - } - - private int precision_ = 0; - private int scale_ = 0; - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Decimal.newBuilder() to construct. - private Decimal(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Decimal() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Decimal prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Decimal.class, io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder.class); - } - - /** - * uint32 precision = 1; - * - * @return The precision. - */ - @java.lang.Override - public int getPrecision() { - return precision_; - } - - /** - * int32 scale = 2; - * - * @return The scale. - */ - @java.lang.Override - public int getScale() { - return scale_; - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (precision_ != 0) { - output.writeUInt32(1, precision_); - } - if (scale_ != 0) { - output.writeInt32(2, scale_); - } - if (nullable_ != false) { - output.writeBool(3, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (precision_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, precision_); - } - if (scale_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, scale_); - } - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Decimal)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Decimal other = (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) obj; - - if (getPrecision() - != other.getPrecision()) { - return false; - } - if (getScale() - != other.getScale()) { - return false; - } - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PRECISION_FIELD_NUMBER; - hash = (53 * hash) + getPrecision(); - hash = (37 * hash) + SCALE_FIELD_NUMBER; - hash = (53 * hash) + getScale(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Decimal} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Decimal) - io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder { - private int bitField0_; - private int precision_; - private int scale_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Decimal.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Decimal.class, io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - precision_ = 0; - scale_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Decimal_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal build() { - io.github.dfa1.vortex.proto.DTypeProtos.Decimal result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Decimal result = new io.github.dfa1.vortex.proto.DTypeProtos.Decimal(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Decimal result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.precision_ = precision_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.scale_ = scale_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Decimal) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Decimal) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Decimal other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance()) { - return this; - } - if (other.getPrecision() != 0) { - setPrecision(other.getPrecision()); - } - if (other.getScale() != 0) { - setScale(other.getScale()); - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - precision_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - scale_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 precision = 1; - * - * @return The precision. - */ - @java.lang.Override - public int getPrecision() { - return precision_; - } - - /** - * uint32 precision = 1; - * - * @param value The precision to set. - * @return This builder for chaining. - */ - public Builder setPrecision(int value) { - - precision_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 precision = 1; - * - * @return This builder for chaining. - */ - public Builder clearPrecision() { - bitField0_ = (bitField0_ & ~0x00000001); - precision_ = 0; - onChanged(); - return this; - } - - /** - * int32 scale = 2; - * - * @return The scale. - */ - @java.lang.Override - public int getScale() { - return scale_; - } - - /** - * int32 scale = 2; - * - * @param value The scale to set. - * @return This builder for chaining. - */ - public Builder setScale(int value) { - - scale_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * int32 scale = 2; - * - * @return This builder for chaining. - */ - public Builder clearScale() { - bitField0_ = (bitField0_ & ~0x00000002); - scale_ = 0; - onChanged(); - return this; - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 3; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * bool nullable = 3; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000004); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Decimal) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Utf8} - */ - public static final class Utf8 extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Utf8) - Utf8OrBuilder { - public static final int NULLABLE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Utf8) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Utf8 DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Utf8 parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Utf8"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Utf8(); - } - - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Utf8.newBuilder() to construct. - private Utf8(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Utf8() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Utf8 prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Utf8.class, io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder.class); - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nullable_ != false) { - output.writeBool(1, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Utf8)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Utf8 other = (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) obj; - - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Utf8} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Utf8) - io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder { - private int bitField0_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Utf8.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Utf8.class, io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Utf8_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 build() { - io.github.dfa1.vortex.proto.DTypeProtos.Utf8 result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Utf8 result = new io.github.dfa1.vortex.proto.DTypeProtos.Utf8(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Utf8 result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Utf8) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Utf8) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Utf8 other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance()) { - return this; - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 1; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bool nullable = 1; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Utf8) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Binary} - */ - public static final class Binary extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Binary) - BinaryOrBuilder { - public static final int NULLABLE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Binary) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Binary DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Binary parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Binary"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Binary(); - } - - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Binary.newBuilder() to construct. - private Binary(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Binary() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Binary prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Binary getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Binary.class, io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder.class); - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nullable_ != false) { - output.writeBool(1, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Binary)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Binary other = (io.github.dfa1.vortex.proto.DTypeProtos.Binary) obj; - - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Binary} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Binary) - io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder { - private int bitField0_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Binary.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Binary.class, io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Binary_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary build() { - io.github.dfa1.vortex.proto.DTypeProtos.Binary result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Binary result = new io.github.dfa1.vortex.proto.DTypeProtos.Binary(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Binary result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Binary) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Binary) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Binary other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance()) { - return this; - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 1; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bool nullable = 1; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Binary) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Struct} - */ - public static final class Struct extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Struct) - StructOrBuilder { - public static final int NAMES_FIELD_NUMBER = 1; - public static final int DTYPES_FIELD_NUMBER = 2; - public static final int NULLABLE_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Struct) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Struct DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Struct parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Struct"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Struct(); - } - - @SuppressWarnings("serial") - private com.google.protobuf.LazyStringArrayList names_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - @SuppressWarnings("serial") - private java.util.List dtypes_; - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Struct.newBuilder() to construct. - private Struct(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Struct() { - names_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - dtypes_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Struct prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Struct getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Struct.class, io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder.class); - } - - /** - * repeated string names = 1; - * - * @return A list containing the names. - */ - public com.google.protobuf.ProtocolStringList - getNamesList() { - return names_; - } - - /** - * repeated string names = 1; - * - * @return The count of names. - */ - public int getNamesCount() { - return names_.size(); - } - - /** - * repeated string names = 1; - * - * @param index The index of the element to return. - * @return The names at the given index. - */ - public java.lang.String getNames(int index) { - return names_.get(index); - } - - /** - * repeated string names = 1; - * - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - public com.google.protobuf.ByteString - getNamesBytes(int index) { - return names_.getByteString(index); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - @java.lang.Override - public java.util.List getDtypesList() { - return dtypes_; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - @java.lang.Override - public java.util.List - getDtypesOrBuilderList() { - return dtypes_; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - @java.lang.Override - public int getDtypesCount() { - return dtypes_.size(); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDtypes(int index) { - return dtypes_.get(index); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypesOrBuilder( - int index) { - return dtypes_.get(index); - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < names_.size(); i++) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, names_.getRaw(i)); - } - for (int i = 0; i < dtypes_.size(); i++) { - output.writeMessage(2, dtypes_.get(i)); - } - if (nullable_ != false) { - output.writeBool(3, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - { - int dataSize = 0; - for (int i = 0; i < names_.size(); i++) { - dataSize += computeStringSizeNoTag(names_.getRaw(i)); - } - size += dataSize; - size += 1 * getNamesList().size(); - } - - { - final int count = dtypes_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(dtypes_.get(i)); - } - size += 1 * count; - } - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Struct)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Struct other = (io.github.dfa1.vortex.proto.DTypeProtos.Struct) obj; - - if (!getNamesList() - .equals(other.getNamesList())) { - return false; - } - if (!getDtypesList() - .equals(other.getDtypesList())) { - return false; - } - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getNamesCount() > 0) { - hash = (37 * hash) + NAMES_FIELD_NUMBER; - hash = (53 * hash) + getNamesList().hashCode(); - } - if (getDtypesCount() > 0) { - hash = (37 * hash) + DTYPES_FIELD_NUMBER; - hash = (53 * hash) + getDtypesList().hashCode(); - } - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Struct} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Struct) - io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder { - private int bitField0_; - private com.google.protobuf.LazyStringArrayList names_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - private java.util.List dtypes_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> dtypesBuilder_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Struct.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Struct.class, io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - names_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - if (dtypesBuilder_ == null) { - dtypes_ = java.util.Collections.emptyList(); - } else { - dtypes_ = null; - dtypesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Struct_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct build() { - io.github.dfa1.vortex.proto.DTypeProtos.Struct result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Struct result = new io.github.dfa1.vortex.proto.DTypeProtos.Struct(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.DTypeProtos.Struct result) { - if (dtypesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - dtypes_ = java.util.Collections.unmodifiableList(dtypes_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.dtypes_ = dtypes_; - } else { - result.dtypes_ = dtypesBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Struct result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - names_.makeImmutable(); - result.names_ = names_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Struct) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Struct) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Struct other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance()) { - return this; - } - if (!other.names_.isEmpty()) { - if (names_.isEmpty()) { - names_ = other.names_; - bitField0_ |= 0x00000001; - } else { - ensureNamesIsMutable(); - names_.addAll(other.names_); - } - onChanged(); - } - if (dtypesBuilder_ == null) { - if (!other.dtypes_.isEmpty()) { - if (dtypes_.isEmpty()) { - dtypes_ = other.dtypes_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureDtypesIsMutable(); - dtypes_.addAll(other.dtypes_); - } - onChanged(); - } - } else { - if (!other.dtypes_.isEmpty()) { - if (dtypesBuilder_.isEmpty()) { - dtypesBuilder_.dispose(); - dtypesBuilder_ = null; - dtypes_ = other.dtypes_; - bitField0_ = (bitField0_ & ~0x00000002); - dtypesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetDtypesFieldBuilder() : null; - } else { - dtypesBuilder_.addAllMessages(other.dtypes_); - } - } - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - ensureNamesIsMutable(); - names_.add(input.readStringRequireUtf8()); - break; - } // case 10 - case 18: { - io.github.dfa1.vortex.proto.DTypeProtos.DType m = - input.readMessage( - io.github.dfa1.vortex.proto.DTypeProtos.DType.parser(), - extensionRegistry); - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - dtypes_.add(m); - } else { - dtypesBuilder_.addMessage(m); - } - break; - } // case 18 - case 24: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private void ensureNamesIsMutable() { - if (!names_.isModifiable()) { - names_ = new com.google.protobuf.LazyStringArrayList(names_); - } - bitField0_ |= 0x00000001; - } - - /** - * repeated string names = 1; - * - * @return A list containing the names. - */ - public com.google.protobuf.ProtocolStringList - getNamesList() { - names_.makeImmutable(); - return names_; - } - - /** - * repeated string names = 1; - * - * @return The count of names. - */ - public int getNamesCount() { - return names_.size(); - } - - /** - * repeated string names = 1; - * - * @param index The index of the element to return. - * @return The names at the given index. - */ - public java.lang.String getNames(int index) { - return names_.get(index); - } - - /** - * repeated string names = 1; - * - * @param index The index of the value to return. - * @return The bytes of the names at the given index. - */ - public com.google.protobuf.ByteString - getNamesBytes(int index) { - return names_.getByteString(index); - } - - /** - * repeated string names = 1; - * - * @param index The index to set the value at. - * @param value The names to set. - * @return This builder for chaining. - */ - public Builder setNames( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNamesIsMutable(); - names_.set(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * repeated string names = 1; - * - * @param value The names to add. - * @return This builder for chaining. - */ - public Builder addNames( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNamesIsMutable(); - names_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * repeated string names = 1; - * - * @param values The names to add. - * @return This builder for chaining. - */ - public Builder addAllNames( - java.lang.Iterable values) { - ensureNamesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, names_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * repeated string names = 1; - * - * @return This builder for chaining. - */ - public Builder clearNames() { - names_ = - com.google.protobuf.LazyStringArrayList.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - ; - onChanged(); - return this; - } - - /** - * repeated string names = 1; - * - * @param value The bytes of the names to add. - * @return This builder for chaining. - */ - public Builder addNamesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureNamesIsMutable(); - names_.add(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - private void ensureDtypesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - dtypes_ = new java.util.ArrayList(dtypes_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public java.util.List getDtypesList() { - if (dtypesBuilder_ == null) { - return java.util.Collections.unmodifiableList(dtypes_); - } else { - return dtypesBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public int getDtypesCount() { - if (dtypesBuilder_ == null) { - return dtypes_.size(); - } else { - return dtypesBuilder_.getCount(); - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDtypes(int index) { - if (dtypesBuilder_ == null) { - return dtypes_.get(index); - } else { - return dtypesBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder setDtypes( - int index, io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (dtypesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesIsMutable(); - dtypes_.set(index, value); - onChanged(); - } else { - dtypesBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder setDtypes( - int index, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - dtypes_.set(index, builderForValue.build()); - onChanged(); - } else { - dtypesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder addDtypes(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (dtypesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesIsMutable(); - dtypes_.add(value); - onChanged(); - } else { - dtypesBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder addDtypes( - int index, io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (dtypesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDtypesIsMutable(); - dtypes_.add(index, value); - onChanged(); - } else { - dtypesBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder addDtypes( - io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - dtypes_.add(builderForValue.build()); - onChanged(); - } else { - dtypesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder addDtypes( - int index, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - dtypes_.add(index, builderForValue.build()); - onChanged(); - } else { - dtypesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder addAllDtypes( - java.lang.Iterable values) { - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dtypes_); - onChanged(); - } else { - dtypesBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder clearDtypes() { - if (dtypesBuilder_ == null) { - dtypes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - dtypesBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public Builder removeDtypes(int index) { - if (dtypesBuilder_ == null) { - ensureDtypesIsMutable(); - dtypes_.remove(index); - onChanged(); - } else { - dtypesBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder getDtypesBuilder( - int index) { - return internalGetDtypesFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypesOrBuilder( - int index) { - if (dtypesBuilder_ == null) { - return dtypes_.get(index); - } else { - return dtypesBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public java.util.List - getDtypesOrBuilderList() { - if (dtypesBuilder_ != null) { - return dtypesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(dtypes_); - } - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder addDtypesBuilder() { - return internalGetDtypesFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder addDtypesBuilder( - int index) { - return internalGetDtypesFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()); - } - - /** - * repeated .vortex.dtype.DType dtypes = 2; - */ - public java.util.List - getDtypesBuilderList() { - return internalGetDtypesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> - internalGetDtypesFieldBuilder() { - if (dtypesBuilder_ == null) { - dtypesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder>( - dtypes_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - dtypes_ = null; - } - return dtypesBuilder_; - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 3; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * bool nullable = 3; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000004); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Struct) - } - - } - - /** - * Protobuf type {@code vortex.dtype.List} - */ - public static final class List extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.List) - ListOrBuilder { - public static final int ELEMENT_TYPE_FIELD_NUMBER = 1; - public static final int NULLABLE_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.List) - private static final io.github.dfa1.vortex.proto.DTypeProtos.List DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public List parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "List"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.List(); - } - - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType elementType_; - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use List.newBuilder() to construct. - private List(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private List() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.List prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.List getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.List.class, io.github.dfa1.vortex.proto.DTypeProtos.List.Builder.class); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - @java.lang.Override - public boolean hasElementType() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType() { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder() { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getElementType()); - } - if (nullable_ != false) { - output.writeBool(2, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getElementType()); - } - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.List)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.List other = (io.github.dfa1.vortex.proto.DTypeProtos.List) obj; - - if (hasElementType() != other.hasElementType()) { - return false; - } - if (hasElementType()) { - if (!getElementType() - .equals(other.getElementType())) { - return false; - } - } - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasElementType()) { - hash = (37 * hash) + ELEMENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getElementType().hashCode(); - } - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.List} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.List) - io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder { - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType elementType_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> elementTypeBuilder_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.List.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.List.class, io.github.dfa1.vortex.proto.DTypeProtos.List.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetElementTypeFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - elementType_ = null; - if (elementTypeBuilder_ != null) { - elementTypeBuilder_.dispose(); - elementTypeBuilder_ = null; - } - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_List_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List build() { - io.github.dfa1.vortex.proto.DTypeProtos.List result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.List result = new io.github.dfa1.vortex.proto.DTypeProtos.List(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.List result) { - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.elementType_ = elementTypeBuilder_ == null - ? elementType_ - : elementTypeBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nullable_ = nullable_; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.List) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.List) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.List other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance()) { - return this; - } - if (other.hasElementType()) { - mergeElementType(other.getElementType()); - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetElementTypeFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - public boolean hasElementType() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType() { - if (elementTypeBuilder_ == null) { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } else { - return elementTypeBuilder_.getMessage(); - } - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder setElementType(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (elementTypeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - elementType_ = value; - } else { - elementTypeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder setElementType( - io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (elementTypeBuilder_ == null) { - elementType_ = builderForValue.build(); - } else { - elementTypeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder mergeElementType(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (elementTypeBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - elementType_ != null && - elementType_ != io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()) { - getElementTypeBuilder().mergeFrom(value); - } else { - elementType_ = value; - } - } else { - elementTypeBuilder_.mergeFrom(value); - } - if (elementType_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder clearElementType() { - bitField0_ = (bitField0_ & ~0x00000001); - elementType_ = null; - if (elementTypeBuilder_ != null) { - elementTypeBuilder_.dispose(); - elementTypeBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder getElementTypeBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return internalGetElementTypeFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder() { - if (elementTypeBuilder_ != null) { - return elementTypeBuilder_.getMessageOrBuilder(); - } else { - return elementType_ == null ? - io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> - internalGetElementTypeFieldBuilder() { - if (elementTypeBuilder_ == null) { - elementTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder>( - getElementType(), - getParentForChildren(), - isClean()); - elementType_ = null; - } - return elementTypeBuilder_; - } - - /** - * bool nullable = 2; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 2; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * bool nullable = 2; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000002); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.List) - } - - } - - /** - * Protobuf type {@code vortex.dtype.FixedSizeList} - */ - public static final class FixedSizeList extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.FixedSizeList) - FixedSizeListOrBuilder { - public static final int ELEMENT_TYPE_FIELD_NUMBER = 1; - public static final int SIZE_FIELD_NUMBER = 2; - public static final int NULLABLE_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.FixedSizeList) - private static final io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FixedSizeList parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "FixedSizeList"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList(); - } - - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType elementType_; - private int size_ = 0; - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use FixedSizeList.newBuilder() to construct. - private FixedSizeList(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private FixedSizeList() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.class, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder.class); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - @java.lang.Override - public boolean hasElementType() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType() { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder() { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - - /** - * uint32 size = 2; - * - * @return The size. - */ - @java.lang.Override - public int getSize() { - return size_; - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getElementType()); - } - if (size_ != 0) { - output.writeUInt32(2, size_); - } - if (nullable_ != false) { - output.writeBool(3, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getElementType()); - } - if (size_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, size_); - } - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList other = (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) obj; - - if (hasElementType() != other.hasElementType()) { - return false; - } - if (hasElementType()) { - if (!getElementType() - .equals(other.getElementType())) { - return false; - } - } - if (getSize() - != other.getSize()) { - return false; - } - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasElementType()) { - hash = (37 * hash) + ELEMENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getElementType().hashCode(); - } - hash = (37 * hash) + SIZE_FIELD_NUMBER; - hash = (53 * hash) + getSize(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.FixedSizeList} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.FixedSizeList) - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder { - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType elementType_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> elementTypeBuilder_; - private int size_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.class, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetElementTypeFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - elementType_ = null; - if (elementTypeBuilder_ != null) { - elementTypeBuilder_.dispose(); - elementTypeBuilder_ = null; - } - size_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FixedSizeList_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList build() { - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList result = new io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList result) { - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.elementType_ = elementTypeBuilder_ == null - ? elementType_ - : elementTypeBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.size_ = size_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.nullable_ = nullable_; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance()) { - return this; - } - if (other.hasElementType()) { - mergeElementType(other.getElementType()); - } - if (other.getSize() != 0) { - setSize(other.getSize()); - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetElementTypeFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 16: { - size_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return Whether the elementType field is set. - */ - public boolean hasElementType() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType element_type = 1; - * - * @return The elementType. - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType getElementType() { - if (elementTypeBuilder_ == null) { - return elementType_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } else { - return elementTypeBuilder_.getMessage(); - } - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder setElementType(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (elementTypeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - elementType_ = value; - } else { - elementTypeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder setElementType( - io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (elementTypeBuilder_ == null) { - elementType_ = builderForValue.build(); - } else { - elementTypeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder mergeElementType(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (elementTypeBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - elementType_ != null && - elementType_ != io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()) { - getElementTypeBuilder().mergeFrom(value); - } else { - elementType_ = value; - } - } else { - elementTypeBuilder_.mergeFrom(value); - } - if (elementType_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public Builder clearElementType() { - bitField0_ = (bitField0_ & ~0x00000001); - elementType_ = null; - if (elementTypeBuilder_ != null) { - elementTypeBuilder_.dispose(); - elementTypeBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder getElementTypeBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return internalGetElementTypeFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getElementTypeOrBuilder() { - if (elementTypeBuilder_ != null) { - return elementTypeBuilder_.getMessageOrBuilder(); - } else { - return elementType_ == null ? - io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : elementType_; - } - } - - /** - * .vortex.dtype.DType element_type = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> - internalGetElementTypeFieldBuilder() { - if (elementTypeBuilder_ == null) { - elementTypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder>( - getElementType(), - getParentForChildren(), - isClean()); - elementType_ = null; - } - return elementTypeBuilder_; - } - - /** - * uint32 size = 2; - * - * @return The size. - */ - @java.lang.Override - public int getSize() { - return size_; - } - - /** - * uint32 size = 2; - * - * @param value The size to set. - * @return This builder for chaining. - */ - public Builder setSize(int value) { - - size_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 size = 2; - * - * @return This builder for chaining. - */ - public Builder clearSize() { - bitField0_ = (bitField0_ & ~0x00000002); - size_ = 0; - onChanged(); - return this; - } - - /** - * bool nullable = 3; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 3; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * bool nullable = 3; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000004); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.FixedSizeList) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Extension} - */ - public static final class Extension extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Extension) - ExtensionOrBuilder { - public static final int ID_FIELD_NUMBER = 1; - public static final int STORAGE_DTYPE_FIELD_NUMBER = 2; - public static final int METADATA_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Extension) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Extension DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Extension parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Extension"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Extension(); - } - - private int bitField0_; - @SuppressWarnings("serial") - private volatile java.lang.Object id_ = ""; - private io.github.dfa1.vortex.proto.DTypeProtos.DType storageDtype_; - private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; - private byte memoizedIsInitialized = -1; - - // Use Extension.newBuilder() to construct. - private Extension(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Extension() { - id_ = ""; - metadata_ = com.google.protobuf.ByteString.EMPTY; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Extension prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Extension getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Extension.class, io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder.class); - } - - /** - * string id = 1; - * - * @return The id. - */ - @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } - } - - /** - * string id = 1; - * - * @return The bytes for id. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return Whether the storageDtype field is set. - */ - @java.lang.Override - public boolean hasStorageDtype() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return The storageDtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getStorageDtype() { - return storageDtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : storageDtype_; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getStorageDtypeOrBuilder() { - return storageDtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : storageDtype_; - } - - /** - * optional bytes metadata = 3; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * optional bytes metadata = 3; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, id_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(2, getStorageDtype()); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeBytes(3, metadata_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getStorageDtype()); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, metadata_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Extension)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Extension other = (io.github.dfa1.vortex.proto.DTypeProtos.Extension) obj; - - if (!getId() - .equals(other.getId())) { - return false; - } - if (hasStorageDtype() != other.hasStorageDtype()) { - return false; - } - if (hasStorageDtype()) { - if (!getStorageDtype() - .equals(other.getStorageDtype())) { - return false; - } - } - if (hasMetadata() != other.hasMetadata()) { - return false; - } - if (hasMetadata()) { - if (!getMetadata() - .equals(other.getMetadata())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - if (hasStorageDtype()) { - hash = (37 * hash) + STORAGE_DTYPE_FIELD_NUMBER; - hash = (53 * hash) + getStorageDtype().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Extension} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Extension) - io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder { - private int bitField0_; - private java.lang.Object id_ = ""; - private io.github.dfa1.vortex.proto.DTypeProtos.DType storageDtype_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> storageDtypeBuilder_; - private com.google.protobuf.ByteString metadata_ = com.google.protobuf.ByteString.EMPTY; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Extension.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Extension.class, io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetStorageDtypeFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - id_ = ""; - storageDtype_ = null; - if (storageDtypeBuilder_ != null) { - storageDtypeBuilder_.dispose(); - storageDtypeBuilder_ = null; - } - metadata_ = com.google.protobuf.ByteString.EMPTY; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Extension_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension build() { - io.github.dfa1.vortex.proto.DTypeProtos.Extension result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Extension result = new io.github.dfa1.vortex.proto.DTypeProtos.Extension(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Extension result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.id_ = id_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000002) != 0)) { - result.storageDtype_ = storageDtypeBuilder_ == null - ? storageDtype_ - : storageDtypeBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.metadata_ = metadata_; - to_bitField0_ |= 0x00000002; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Extension) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Extension) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Extension other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance()) { - return this; - } - if (!other.getId().isEmpty()) { - id_ = other.id_; - bitField0_ |= 0x00000001; - onChanged(); - } - if (other.hasStorageDtype()) { - mergeStorageDtype(other.getStorageDtype()); - } - if (other.hasMetadata()) { - setMetadata(other.getMetadata()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - id_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: { - input.readMessage( - internalGetStorageDtypeFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - case 26: { - metadata_ = input.readBytes(); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * string id = 1; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - id_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * string id = 1; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString - getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string id = 1; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - id_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * string id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { - id_ = getDefaultInstance().getId(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return Whether the storageDtype field is set. - */ - public boolean hasStorageDtype() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - * - * @return The storageDtype. - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType getStorageDtype() { - if (storageDtypeBuilder_ == null) { - return storageDtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : storageDtype_; - } else { - return storageDtypeBuilder_.getMessage(); - } - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public Builder setStorageDtype(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (storageDtypeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - storageDtype_ = value; - } else { - storageDtypeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public Builder setStorageDtype( - io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (storageDtypeBuilder_ == null) { - storageDtype_ = builderForValue.build(); - } else { - storageDtypeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public Builder mergeStorageDtype(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (storageDtypeBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) && - storageDtype_ != null && - storageDtype_ != io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()) { - getStorageDtypeBuilder().mergeFrom(value); - } else { - storageDtype_ = value; - } - } else { - storageDtypeBuilder_.mergeFrom(value); - } - if (storageDtype_ != null) { - bitField0_ |= 0x00000002; - onChanged(); - } - return this; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public Builder clearStorageDtype() { - bitField0_ = (bitField0_ & ~0x00000002); - storageDtype_ = null; - if (storageDtypeBuilder_ != null) { - storageDtypeBuilder_.dispose(); - storageDtypeBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder getStorageDtypeBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return internalGetStorageDtypeFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getStorageDtypeOrBuilder() { - if (storageDtypeBuilder_ != null) { - return storageDtypeBuilder_.getMessageOrBuilder(); - } else { - return storageDtype_ == null ? - io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : storageDtype_; - } - } - - /** - * .vortex.dtype.DType storage_dtype = 2; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> - internalGetStorageDtypeFieldBuilder() { - if (storageDtypeBuilder_ == null) { - storageDtypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder>( - getStorageDtype(), - getParentForChildren(), - isClean()); - storageDtype_ = null; - } - return storageDtypeBuilder_; - } - - /** - * optional bytes metadata = 3; - * - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return ((bitField0_ & 0x00000004) != 0); - } - - /** - * optional bytes metadata = 3; - * - * @return The metadata. - */ - @java.lang.Override - public com.google.protobuf.ByteString getMetadata() { - return metadata_; - } - - /** - * optional bytes metadata = 3; - * - * @param value The metadata to set. - * @return This builder for chaining. - */ - public Builder setMetadata(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional bytes metadata = 3; - * - * @return This builder for chaining. - */ - public Builder clearMetadata() { - bitField0_ = (bitField0_ & ~0x00000004); - metadata_ = getDefaultInstance().getMetadata(); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Extension) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Variant} - */ - public static final class Variant extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Variant) - VariantOrBuilder { - public static final int NULLABLE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Variant) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Variant DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Variant parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Variant"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Variant(); - } - - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Variant.newBuilder() to construct. - private Variant(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Variant() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Variant prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Variant getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Variant.class, io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder.class); - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nullable_ != false) { - output.writeBool(1, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Variant)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Variant other = (io.github.dfa1.vortex.proto.DTypeProtos.Variant) obj; - - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Variant} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Variant) - io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder { - private int bitField0_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Variant.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Variant.class, io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Variant_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant build() { - io.github.dfa1.vortex.proto.DTypeProtos.Variant result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Variant result = new io.github.dfa1.vortex.proto.DTypeProtos.Variant(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Variant result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Variant) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Variant) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Variant other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance()) { - return this; - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bool nullable = 1; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 1; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bool nullable = 1; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Variant) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Union} - */ - public static final class Union extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Union) - UnionOrBuilder { - public static final int NULLABLE_FIELD_NUMBER = 4; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Union) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Union DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Union parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Union"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Union(); - } - - private boolean nullable_ = false; - private byte memoizedIsInitialized = -1; - - // Use Union.newBuilder() to construct. - private Union(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Union() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Union prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Union getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Union.class, io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder.class); - } - - /** - * bool nullable = 4; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nullable_ != false) { - output.writeBool(4, nullable_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nullable_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, nullable_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Union)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Union other = (io.github.dfa1.vortex.proto.DTypeProtos.Union) obj; - - if (getNullable() - != other.getNullable()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NULLABLE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getNullable()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.Union} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Union) - io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder { - private int bitField0_; - private boolean nullable_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Union.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Union.class, io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nullable_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Union_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union build() { - io.github.dfa1.vortex.proto.DTypeProtos.Union result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Union result = new io.github.dfa1.vortex.proto.DTypeProtos.Union(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Union result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nullable_ = nullable_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Union) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Union) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Union other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance()) { - return this; - } - if (other.getNullable() != false) { - setNullable(other.getNullable()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 32: { - nullable_ = input.readBool(); - bitField0_ |= 0x00000001; - break; - } // case 32 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bool nullable = 4; - * - * @return The nullable. - */ - @java.lang.Override - public boolean getNullable() { - return nullable_; - } - - /** - * bool nullable = 4; - * - * @param value The nullable to set. - * @return This builder for chaining. - */ - public Builder setNullable(boolean value) { - - nullable_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bool nullable = 4; - * - * @return This builder for chaining. - */ - public Builder clearNullable() { - bitField0_ = (bitField0_ & ~0x00000001); - nullable_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Union) - } - - } - - /** - * Protobuf type {@code vortex.dtype.DType} - */ - public static final class DType extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.DType) - DTypeOrBuilder { - public static final int NULL_FIELD_NUMBER = 1; - public static final int BOOL_FIELD_NUMBER = 2; - public static final int PRIMITIVE_FIELD_NUMBER = 3; - public static final int DECIMAL_FIELD_NUMBER = 4; - public static final int UTF8_FIELD_NUMBER = 5; - public static final int BINARY_FIELD_NUMBER = 6; - public static final int STRUCT_FIELD_NUMBER = 7; - public static final int LIST_FIELD_NUMBER = 8; - public static final int EXTENSION_FIELD_NUMBER = 9; - public static final int FIXED_SIZE_LIST_FIELD_NUMBER = 10; - - ; - public static final int VARIANT_FIELD_NUMBER = 11; - public static final int UNION_FIELD_NUMBER = 12; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.DType) - private static final io.github.dfa1.vortex.proto.DTypeProtos.DType DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DType parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DType"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.DType(); - } - - private int dtypeTypeCase_ = 0; - @SuppressWarnings("serial") - private java.lang.Object dtypeType_; - private byte memoizedIsInitialized = -1; - - // Use DType.newBuilder() to construct. - private DType(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DType() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.DType prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.DType getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.DType.class, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder.class); - } - - public DtypeTypeCase - getDtypeTypeCase() { - return DtypeTypeCase.forNumber( - dtypeTypeCase_); - } - - /** - * .vortex.dtype.Null null = 1; - * - * @return Whether the null field is set. - */ - @java.lang.Override - public boolean hasNull() { - return dtypeTypeCase_ == 1; - } - - /** - * .vortex.dtype.Null null = 1; - * - * @return The null. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null getNull() { - if (dtypeTypeCase_ == 1) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - - /** - * .vortex.dtype.Null null = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder getNullOrBuilder() { - if (dtypeTypeCase_ == 1) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return Whether the bool field is set. - */ - @java.lang.Override - public boolean hasBool() { - return dtypeTypeCase_ == 2; - } - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return The bool. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool getBool() { - if (dtypeTypeCase_ == 2) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder getBoolOrBuilder() { - if (dtypeTypeCase_ == 2) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return Whether the primitive field is set. - */ - @java.lang.Override - public boolean hasPrimitive() { - return dtypeTypeCase_ == 3; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return The primitive. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive getPrimitive() { - if (dtypeTypeCase_ == 3) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder getPrimitiveOrBuilder() { - if (dtypeTypeCase_ == 3) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return Whether the decimal field is set. - */ - @java.lang.Override - public boolean hasDecimal() { - return dtypeTypeCase_ == 4; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return The decimal. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDecimal() { - if (dtypeTypeCase_ == 4) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder getDecimalOrBuilder() { - if (dtypeTypeCase_ == 4) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return Whether the utf8 field is set. - */ - @java.lang.Override - public boolean hasUtf8() { - return dtypeTypeCase_ == 5; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return The utf8. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getUtf8() { - if (dtypeTypeCase_ == 5) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder getUtf8OrBuilder() { - if (dtypeTypeCase_ == 5) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return Whether the binary field is set. - */ - @java.lang.Override - public boolean hasBinary() { - return dtypeTypeCase_ == 6; - } - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return The binary. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary getBinary() { - if (dtypeTypeCase_ == 6) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder getBinaryOrBuilder() { - if (dtypeTypeCase_ == 6) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return Whether the struct field is set. - */ - @java.lang.Override - public boolean hasStruct() { - return dtypeTypeCase_ == 7; - } - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return The struct. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct getStruct() { - if (dtypeTypeCase_ == 7) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder getStructOrBuilder() { - if (dtypeTypeCase_ == 7) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - - /** - * .vortex.dtype.List list = 8; - * - * @return Whether the list field is set. - */ - @java.lang.Override - public boolean hasList() { - return dtypeTypeCase_ == 8; - } - - /** - * .vortex.dtype.List list = 8; - * - * @return The list. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List getList() { - if (dtypeTypeCase_ == 8) { - return (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - - /** - * .vortex.dtype.List list = 8; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder getListOrBuilder() { - if (dtypeTypeCase_ == 8) { - return (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return Whether the extension field is set. - */ - @java.lang.Override - public boolean hasExtension() { - return dtypeTypeCase_ == 9; - } - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return The extension. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension getExtension() { - if (dtypeTypeCase_ == 9) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder getExtensionOrBuilder() { - if (dtypeTypeCase_ == 9) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return Whether the fixedSizeList field is set. - */ - @java.lang.Override - public boolean hasFixedSizeList() { - return dtypeTypeCase_ == 10; - } - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return The fixedSizeList. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getFixedSizeList() { - if (dtypeTypeCase_ == 10) { - return (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - - /** - *
    -         * This is after `Extension` for backwards compatibility.
    -         * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder getFixedSizeListOrBuilder() { - if (dtypeTypeCase_ == 10) { - return (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return Whether the variant field is set. - */ - @java.lang.Override - public boolean hasVariant() { - return dtypeTypeCase_ == 11; - } - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return The variant. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant getVariant() { - if (dtypeTypeCase_ == 11) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder getVariantOrBuilder() { - if (dtypeTypeCase_ == 11) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - - /** - * .vortex.dtype.Union union = 12; - * - * @return Whether the union field is set. - */ - @java.lang.Override - public boolean hasUnion() { - return dtypeTypeCase_ == 12; - } - - /** - * .vortex.dtype.Union union = 12; - * - * @return The union. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union getUnion() { - if (dtypeTypeCase_ == 12) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - - /** - * .vortex.dtype.Union union = 12; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder getUnionOrBuilder() { - if (dtypeTypeCase_ == 12) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (dtypeTypeCase_ == 1) { - output.writeMessage(1, (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_); - } - if (dtypeTypeCase_ == 2) { - output.writeMessage(2, (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_); - } - if (dtypeTypeCase_ == 3) { - output.writeMessage(3, (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_); - } - if (dtypeTypeCase_ == 4) { - output.writeMessage(4, (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_); - } - if (dtypeTypeCase_ == 5) { - output.writeMessage(5, (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_); - } - if (dtypeTypeCase_ == 6) { - output.writeMessage(6, (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_); - } - if (dtypeTypeCase_ == 7) { - output.writeMessage(7, (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_); - } - if (dtypeTypeCase_ == 8) { - output.writeMessage(8, (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_); - } - if (dtypeTypeCase_ == 9) { - output.writeMessage(9, (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_); - } - if (dtypeTypeCase_ == 10) { - output.writeMessage(10, (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_); - } - if (dtypeTypeCase_ == 11) { - output.writeMessage(11, (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_); - } - if (dtypeTypeCase_ == 12) { - output.writeMessage(12, (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (dtypeTypeCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_); - } - if (dtypeTypeCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_); - } - if (dtypeTypeCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_); - } - if (dtypeTypeCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_); - } - if (dtypeTypeCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_); - } - if (dtypeTypeCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_); - } - if (dtypeTypeCase_ == 7) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_); - } - if (dtypeTypeCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_); - } - if (dtypeTypeCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_); - } - if (dtypeTypeCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_); - } - if (dtypeTypeCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_); - } - if (dtypeTypeCase_ == 12) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(12, (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.DType)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.DType other = (io.github.dfa1.vortex.proto.DTypeProtos.DType) obj; - - if (!getDtypeTypeCase().equals(other.getDtypeTypeCase())) { - return false; - } - switch (dtypeTypeCase_) { - case 1: - if (!getNull() - .equals(other.getNull())) { - return false; - } - break; - case 2: - if (!getBool() - .equals(other.getBool())) { - return false; - } - break; - case 3: - if (!getPrimitive() - .equals(other.getPrimitive())) { - return false; - } - break; - case 4: - if (!getDecimal() - .equals(other.getDecimal())) { - return false; - } - break; - case 5: - if (!getUtf8() - .equals(other.getUtf8())) { - return false; - } - break; - case 6: - if (!getBinary() - .equals(other.getBinary())) { - return false; - } - break; - case 7: - if (!getStruct() - .equals(other.getStruct())) { - return false; - } - break; - case 8: - if (!getList() - .equals(other.getList())) { - return false; - } - break; - case 9: - if (!getExtension() - .equals(other.getExtension())) { - return false; - } - break; - case 10: - if (!getFixedSizeList() - .equals(other.getFixedSizeList())) { - return false; - } - break; - case 11: - if (!getVariant() - .equals(other.getVariant())) { - return false; - } - break; - case 12: - if (!getUnion() - .equals(other.getUnion())) { - return false; - } - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (dtypeTypeCase_) { - case 1: - hash = (37 * hash) + NULL_FIELD_NUMBER; - hash = (53 * hash) + getNull().hashCode(); - break; - case 2: - hash = (37 * hash) + BOOL_FIELD_NUMBER; - hash = (53 * hash) + getBool().hashCode(); - break; - case 3: - hash = (37 * hash) + PRIMITIVE_FIELD_NUMBER; - hash = (53 * hash) + getPrimitive().hashCode(); - break; - case 4: - hash = (37 * hash) + DECIMAL_FIELD_NUMBER; - hash = (53 * hash) + getDecimal().hashCode(); - break; - case 5: - hash = (37 * hash) + UTF8_FIELD_NUMBER; - hash = (53 * hash) + getUtf8().hashCode(); - break; - case 6: - hash = (37 * hash) + BINARY_FIELD_NUMBER; - hash = (53 * hash) + getBinary().hashCode(); - break; - case 7: - hash = (37 * hash) + STRUCT_FIELD_NUMBER; - hash = (53 * hash) + getStruct().hashCode(); - break; - case 8: - hash = (37 * hash) + LIST_FIELD_NUMBER; - hash = (53 * hash) + getList().hashCode(); - break; - case 9: - hash = (37 * hash) + EXTENSION_FIELD_NUMBER; - hash = (53 * hash) + getExtension().hashCode(); - break; - case 10: - hash = (37 * hash) + FIXED_SIZE_LIST_FIELD_NUMBER; - hash = (53 * hash) + getFixedSizeList().hashCode(); - break; - case 11: - hash = (37 * hash) + VARIANT_FIELD_NUMBER; - hash = (53 * hash) + getVariant().hashCode(); - break; - case 12: - hash = (37 * hash) + UNION_FIELD_NUMBER; - hash = (53 * hash) + getUnion().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - public enum DtypeTypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - NULL(1), - BOOL(2), - PRIMITIVE(3), - DECIMAL(4), - UTF8(5), - BINARY(6), - STRUCT(7), - LIST(8), - EXTENSION(9), - FIXED_SIZE_LIST(10), - VARIANT(11), - UNION(12), - DTYPETYPE_NOT_SET(0); - private final int value; - - private DtypeTypeCase(int value) { - this.value = value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static DtypeTypeCase valueOf(int value) { - return forNumber(value); - } - - public static DtypeTypeCase forNumber(int value) { - switch (value) { - case 1: - return NULL; - case 2: - return BOOL; - case 3: - return PRIMITIVE; - case 4: - return DECIMAL; - case 5: - return UTF8; - case 6: - return BINARY; - case 7: - return STRUCT; - case 8: - return LIST; - case 9: - return EXTENSION; - case 10: - return FIXED_SIZE_LIST; - case 11: - return VARIANT; - case 12: - return UNION; - case 0: - return DTYPETYPE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - } - - /** - * Protobuf type {@code vortex.dtype.DType} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.DType) - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder { - private int dtypeTypeCase_ = 0; - private java.lang.Object dtypeType_; - private int bitField0_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Null, io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder, io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder> nullBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Bool, io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder> boolBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Primitive, io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder, io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder> primitiveBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Decimal, io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder> decimalBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Utf8, io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder, io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder> utf8Builder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Binary, io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder> binaryBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Struct, io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder, io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder> structBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.List, io.github.dfa1.vortex.proto.DTypeProtos.List.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder> listBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Extension, io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder> extensionBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder> fixedSizeListBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Variant, io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder, io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder> variantBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Union, io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder, io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder> unionBuilder_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.DType.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.DType.class, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (nullBuilder_ != null) { - nullBuilder_.clear(); - } - if (boolBuilder_ != null) { - boolBuilder_.clear(); - } - if (primitiveBuilder_ != null) { - primitiveBuilder_.clear(); - } - if (decimalBuilder_ != null) { - decimalBuilder_.clear(); - } - if (utf8Builder_ != null) { - utf8Builder_.clear(); - } - if (binaryBuilder_ != null) { - binaryBuilder_.clear(); - } - if (structBuilder_ != null) { - structBuilder_.clear(); - } - if (listBuilder_ != null) { - listBuilder_.clear(); - } - if (extensionBuilder_ != null) { - extensionBuilder_.clear(); - } - if (fixedSizeListBuilder_ != null) { - fixedSizeListBuilder_.clear(); - } - if (variantBuilder_ != null) { - variantBuilder_.clear(); - } - if (unionBuilder_ != null) { - unionBuilder_.clear(); - } - dtypeTypeCase_ = 0; - dtypeType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_DType_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType build() { - io.github.dfa1.vortex.proto.DTypeProtos.DType result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.DType result = new io.github.dfa1.vortex.proto.DTypeProtos.DType(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.DType result) { - int from_bitField0_ = bitField0_; - } - - private void buildPartialOneofs(io.github.dfa1.vortex.proto.DTypeProtos.DType result) { - result.dtypeTypeCase_ = dtypeTypeCase_; - result.dtypeType_ = this.dtypeType_; - if (dtypeTypeCase_ == 1 && - nullBuilder_ != null) { - result.dtypeType_ = nullBuilder_.build(); - } - if (dtypeTypeCase_ == 2 && - boolBuilder_ != null) { - result.dtypeType_ = boolBuilder_.build(); - } - if (dtypeTypeCase_ == 3 && - primitiveBuilder_ != null) { - result.dtypeType_ = primitiveBuilder_.build(); - } - if (dtypeTypeCase_ == 4 && - decimalBuilder_ != null) { - result.dtypeType_ = decimalBuilder_.build(); - } - if (dtypeTypeCase_ == 5 && - utf8Builder_ != null) { - result.dtypeType_ = utf8Builder_.build(); - } - if (dtypeTypeCase_ == 6 && - binaryBuilder_ != null) { - result.dtypeType_ = binaryBuilder_.build(); - } - if (dtypeTypeCase_ == 7 && - structBuilder_ != null) { - result.dtypeType_ = structBuilder_.build(); - } - if (dtypeTypeCase_ == 8 && - listBuilder_ != null) { - result.dtypeType_ = listBuilder_.build(); - } - if (dtypeTypeCase_ == 9 && - extensionBuilder_ != null) { - result.dtypeType_ = extensionBuilder_.build(); - } - if (dtypeTypeCase_ == 10 && - fixedSizeListBuilder_ != null) { - result.dtypeType_ = fixedSizeListBuilder_.build(); - } - if (dtypeTypeCase_ == 11 && - variantBuilder_ != null) { - result.dtypeType_ = variantBuilder_.build(); - } - if (dtypeTypeCase_ == 12 && - unionBuilder_ != null) { - result.dtypeType_ = unionBuilder_.build(); - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.DType) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.DType) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.DType other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()) { - return this; - } - switch (other.getDtypeTypeCase()) { - case NULL: { - mergeNull(other.getNull()); - break; - } - case BOOL: { - mergeBool(other.getBool()); - break; - } - case PRIMITIVE: { - mergePrimitive(other.getPrimitive()); - break; - } - case DECIMAL: { - mergeDecimal(other.getDecimal()); - break; - } - case UTF8: { - mergeUtf8(other.getUtf8()); - break; - } - case BINARY: { - mergeBinary(other.getBinary()); - break; - } - case STRUCT: { - mergeStruct(other.getStruct()); - break; - } - case LIST: { - mergeList(other.getList()); - break; - } - case EXTENSION: { - mergeExtension(other.getExtension()); - break; - } - case FIXED_SIZE_LIST: { - mergeFixedSizeList(other.getFixedSizeList()); - break; - } - case VARIANT: { - mergeVariant(other.getVariant()); - break; - } - case UNION: { - mergeUnion(other.getUnion()); - break; - } - case DTYPETYPE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetNullFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 1; - break; - } // case 10 - case 18: { - input.readMessage( - internalGetBoolFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 2; - break; - } // case 18 - case 26: { - input.readMessage( - internalGetPrimitiveFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 3; - break; - } // case 26 - case 34: { - input.readMessage( - internalGetDecimalFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 4; - break; - } // case 34 - case 42: { - input.readMessage( - internalGetUtf8FieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 5; - break; - } // case 42 - case 50: { - input.readMessage( - internalGetBinaryFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 6; - break; - } // case 50 - case 58: { - input.readMessage( - internalGetStructFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 7; - break; - } // case 58 - case 66: { - input.readMessage( - internalGetListFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 8; - break; - } // case 66 - case 74: { - input.readMessage( - internalGetExtensionFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 9; - break; - } // case 74 - case 82: { - input.readMessage( - internalGetFixedSizeListFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 10; - break; - } // case 82 - case 90: { - input.readMessage( - internalGetVariantFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 11; - break; - } // case 90 - case 98: { - input.readMessage( - internalGetUnionFieldBuilder().getBuilder(), - extensionRegistry); - dtypeTypeCase_ = 12; - break; - } // case 98 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - public DtypeTypeCase - getDtypeTypeCase() { - return DtypeTypeCase.forNumber( - dtypeTypeCase_); - } - - public Builder clearDtypeType() { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - return this; - } - - /** - * .vortex.dtype.Null null = 1; - * - * @return Whether the null field is set. - */ - @java.lang.Override - public boolean hasNull() { - return dtypeTypeCase_ == 1; - } - - /** - * .vortex.dtype.Null null = 1; - * - * @return The null. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Null getNull() { - if (nullBuilder_ == null) { - if (dtypeTypeCase_ == 1) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 1) { - return nullBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Null null = 1; - */ - public Builder setNull(io.github.dfa1.vortex.proto.DTypeProtos.Null value) { - if (nullBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - nullBuilder_.setMessage(value); - } - dtypeTypeCase_ = 1; - return this; - } - - /** - * .vortex.dtype.Null null = 1; - */ - public Builder setNull( - io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder builderForValue) { - if (nullBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - nullBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 1; - return this; - } - - /** - * .vortex.dtype.Null null = 1; - */ - public Builder mergeNull(io.github.dfa1.vortex.proto.DTypeProtos.Null value) { - if (nullBuilder_ == null) { - if (dtypeTypeCase_ == 1 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Null.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 1) { - nullBuilder_.mergeFrom(value); - } else { - nullBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 1; - return this; - } - - /** - * .vortex.dtype.Null null = 1; - */ - public Builder clearNull() { - if (nullBuilder_ == null) { - if (dtypeTypeCase_ == 1) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 1) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - nullBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Null null = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder getNullBuilder() { - return internalGetNullFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Null null = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder getNullOrBuilder() { - if ((dtypeTypeCase_ == 1) && (nullBuilder_ != null)) { - return nullBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 1) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Null null = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Null, io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder, io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder> - internalGetNullFieldBuilder() { - if (nullBuilder_ == null) { - if (!(dtypeTypeCase_ == 1)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Null.getDefaultInstance(); - } - nullBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Null, io.github.dfa1.vortex.proto.DTypeProtos.Null.Builder, io.github.dfa1.vortex.proto.DTypeProtos.NullOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Null) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 1; - onChanged(); - return nullBuilder_; - } - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return Whether the bool field is set. - */ - @java.lang.Override - public boolean hasBool() { - return dtypeTypeCase_ == 2; - } - - /** - * .vortex.dtype.Bool bool = 2; - * - * @return The bool. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Bool getBool() { - if (boolBuilder_ == null) { - if (dtypeTypeCase_ == 2) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 2) { - return boolBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - public Builder setBool(io.github.dfa1.vortex.proto.DTypeProtos.Bool value) { - if (boolBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - boolBuilder_.setMessage(value); - } - dtypeTypeCase_ = 2; - return this; - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - public Builder setBool( - io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder builderForValue) { - if (boolBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - boolBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 2; - return this; - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - public Builder mergeBool(io.github.dfa1.vortex.proto.DTypeProtos.Bool value) { - if (boolBuilder_ == null) { - if (dtypeTypeCase_ == 2 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Bool.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 2) { - boolBuilder_.mergeFrom(value); - } else { - boolBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 2; - return this; - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - public Builder clearBool() { - if (boolBuilder_ == null) { - if (dtypeTypeCase_ == 2) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 2) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - boolBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder getBoolBuilder() { - return internalGetBoolFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder getBoolOrBuilder() { - if ((dtypeTypeCase_ == 2) && (boolBuilder_ != null)) { - return boolBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 2) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Bool bool = 2; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Bool, io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder> - internalGetBoolFieldBuilder() { - if (boolBuilder_ == null) { - if (!(dtypeTypeCase_ == 2)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Bool.getDefaultInstance(); - } - boolBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Bool, io.github.dfa1.vortex.proto.DTypeProtos.Bool.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BoolOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Bool) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 2; - onChanged(); - return boolBuilder_; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return Whether the primitive field is set. - */ - @java.lang.Override - public boolean hasPrimitive() { - return dtypeTypeCase_ == 3; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - * - * @return The primitive. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive getPrimitive() { - if (primitiveBuilder_ == null) { - if (dtypeTypeCase_ == 3) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 3) { - return primitiveBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - public Builder setPrimitive(io.github.dfa1.vortex.proto.DTypeProtos.Primitive value) { - if (primitiveBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - primitiveBuilder_.setMessage(value); - } - dtypeTypeCase_ = 3; - return this; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - public Builder setPrimitive( - io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder builderForValue) { - if (primitiveBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - primitiveBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 3; - return this; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - public Builder mergePrimitive(io.github.dfa1.vortex.proto.DTypeProtos.Primitive value) { - if (primitiveBuilder_ == null) { - if (dtypeTypeCase_ == 3 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Primitive.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 3) { - primitiveBuilder_.mergeFrom(value); - } else { - primitiveBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 3; - return this; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - public Builder clearPrimitive() { - if (primitiveBuilder_ == null) { - if (dtypeTypeCase_ == 3) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 3) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - primitiveBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder getPrimitiveBuilder() { - return internalGetPrimitiveFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder getPrimitiveOrBuilder() { - if ((dtypeTypeCase_ == 3) && (primitiveBuilder_ != null)) { - return primitiveBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 3) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Primitive primitive = 3; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Primitive, io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder, io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder> - internalGetPrimitiveFieldBuilder() { - if (primitiveBuilder_ == null) { - if (!(dtypeTypeCase_ == 3)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Primitive.getDefaultInstance(); - } - primitiveBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Primitive, io.github.dfa1.vortex.proto.DTypeProtos.Primitive.Builder, io.github.dfa1.vortex.proto.DTypeProtos.PrimitiveOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Primitive) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 3; - onChanged(); - return primitiveBuilder_; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return Whether the decimal field is set. - */ - @java.lang.Override - public boolean hasDecimal() { - return dtypeTypeCase_ == 4; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - * - * @return The decimal. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal getDecimal() { - if (decimalBuilder_ == null) { - if (dtypeTypeCase_ == 4) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 4) { - return decimalBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - public Builder setDecimal(io.github.dfa1.vortex.proto.DTypeProtos.Decimal value) { - if (decimalBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - decimalBuilder_.setMessage(value); - } - dtypeTypeCase_ = 4; - return this; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - public Builder setDecimal( - io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder builderForValue) { - if (decimalBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - decimalBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 4; - return this; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - public Builder mergeDecimal(io.github.dfa1.vortex.proto.DTypeProtos.Decimal value) { - if (decimalBuilder_ == null) { - if (dtypeTypeCase_ == 4 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Decimal.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 4) { - decimalBuilder_.mergeFrom(value); - } else { - decimalBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 4; - return this; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - public Builder clearDecimal() { - if (decimalBuilder_ == null) { - if (dtypeTypeCase_ == 4) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 4) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - decimalBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder getDecimalBuilder() { - return internalGetDecimalFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder getDecimalOrBuilder() { - if ((dtypeTypeCase_ == 4) && (decimalBuilder_ != null)) { - return decimalBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 4) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Decimal decimal = 4; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Decimal, io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder> - internalGetDecimalFieldBuilder() { - if (decimalBuilder_ == null) { - if (!(dtypeTypeCase_ == 4)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Decimal.getDefaultInstance(); - } - decimalBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Decimal, io.github.dfa1.vortex.proto.DTypeProtos.Decimal.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DecimalOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Decimal) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 4; - onChanged(); - return decimalBuilder_; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return Whether the utf8 field is set. - */ - @java.lang.Override - public boolean hasUtf8() { - return dtypeTypeCase_ == 5; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - * - * @return The utf8. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8 getUtf8() { - if (utf8Builder_ == null) { - if (dtypeTypeCase_ == 5) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 5) { - return utf8Builder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - public Builder setUtf8(io.github.dfa1.vortex.proto.DTypeProtos.Utf8 value) { - if (utf8Builder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - utf8Builder_.setMessage(value); - } - dtypeTypeCase_ = 5; - return this; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - public Builder setUtf8( - io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder builderForValue) { - if (utf8Builder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - utf8Builder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 5; - return this; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - public Builder mergeUtf8(io.github.dfa1.vortex.proto.DTypeProtos.Utf8 value) { - if (utf8Builder_ == null) { - if (dtypeTypeCase_ == 5 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Utf8.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 5) { - utf8Builder_.mergeFrom(value); - } else { - utf8Builder_.setMessage(value); - } - } - dtypeTypeCase_ = 5; - return this; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - public Builder clearUtf8() { - if (utf8Builder_ == null) { - if (dtypeTypeCase_ == 5) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 5) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - utf8Builder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder getUtf8Builder() { - return internalGetUtf8FieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder getUtf8OrBuilder() { - if ((dtypeTypeCase_ == 5) && (utf8Builder_ != null)) { - return utf8Builder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 5) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Utf8 utf8 = 5; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Utf8, io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder, io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder> - internalGetUtf8FieldBuilder() { - if (utf8Builder_ == null) { - if (!(dtypeTypeCase_ == 5)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Utf8.getDefaultInstance(); - } - utf8Builder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Utf8, io.github.dfa1.vortex.proto.DTypeProtos.Utf8.Builder, io.github.dfa1.vortex.proto.DTypeProtos.Utf8OrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Utf8) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 5; - onChanged(); - return utf8Builder_; - } - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return Whether the binary field is set. - */ - @java.lang.Override - public boolean hasBinary() { - return dtypeTypeCase_ == 6; - } - - /** - * .vortex.dtype.Binary binary = 6; - * - * @return The binary. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Binary getBinary() { - if (binaryBuilder_ == null) { - if (dtypeTypeCase_ == 6) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 6) { - return binaryBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - public Builder setBinary(io.github.dfa1.vortex.proto.DTypeProtos.Binary value) { - if (binaryBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - binaryBuilder_.setMessage(value); - } - dtypeTypeCase_ = 6; - return this; - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - public Builder setBinary( - io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder builderForValue) { - if (binaryBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - binaryBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 6; - return this; - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - public Builder mergeBinary(io.github.dfa1.vortex.proto.DTypeProtos.Binary value) { - if (binaryBuilder_ == null) { - if (dtypeTypeCase_ == 6 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Binary.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 6) { - binaryBuilder_.mergeFrom(value); - } else { - binaryBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 6; - return this; - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - public Builder clearBinary() { - if (binaryBuilder_ == null) { - if (dtypeTypeCase_ == 6) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 6) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - binaryBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder getBinaryBuilder() { - return internalGetBinaryFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder getBinaryOrBuilder() { - if ((dtypeTypeCase_ == 6) && (binaryBuilder_ != null)) { - return binaryBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 6) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Binary binary = 6; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Binary, io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder> - internalGetBinaryFieldBuilder() { - if (binaryBuilder_ == null) { - if (!(dtypeTypeCase_ == 6)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Binary.getDefaultInstance(); - } - binaryBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Binary, io.github.dfa1.vortex.proto.DTypeProtos.Binary.Builder, io.github.dfa1.vortex.proto.DTypeProtos.BinaryOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Binary) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 6; - onChanged(); - return binaryBuilder_; - } - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return Whether the struct field is set. - */ - @java.lang.Override - public boolean hasStruct() { - return dtypeTypeCase_ == 7; - } - - /** - * .vortex.dtype.Struct struct = 7; - * - * @return The struct. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Struct getStruct() { - if (structBuilder_ == null) { - if (dtypeTypeCase_ == 7) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 7) { - return structBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - public Builder setStruct(io.github.dfa1.vortex.proto.DTypeProtos.Struct value) { - if (structBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - structBuilder_.setMessage(value); - } - dtypeTypeCase_ = 7; - return this; - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - public Builder setStruct( - io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder builderForValue) { - if (structBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - structBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 7; - return this; - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - public Builder mergeStruct(io.github.dfa1.vortex.proto.DTypeProtos.Struct value) { - if (structBuilder_ == null) { - if (dtypeTypeCase_ == 7 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Struct.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 7) { - structBuilder_.mergeFrom(value); - } else { - structBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 7; - return this; - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - public Builder clearStruct() { - if (structBuilder_ == null) { - if (dtypeTypeCase_ == 7) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 7) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - structBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder getStructBuilder() { - return internalGetStructFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder getStructOrBuilder() { - if ((dtypeTypeCase_ == 7) && (structBuilder_ != null)) { - return structBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 7) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Struct struct = 7; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Struct, io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder, io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder> - internalGetStructFieldBuilder() { - if (structBuilder_ == null) { - if (!(dtypeTypeCase_ == 7)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Struct.getDefaultInstance(); - } - structBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Struct, io.github.dfa1.vortex.proto.DTypeProtos.Struct.Builder, io.github.dfa1.vortex.proto.DTypeProtos.StructOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Struct) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 7; - onChanged(); - return structBuilder_; - } - - /** - * .vortex.dtype.List list = 8; - * - * @return Whether the list field is set. - */ - @java.lang.Override - public boolean hasList() { - return dtypeTypeCase_ == 8; - } - - /** - * .vortex.dtype.List list = 8; - * - * @return The list. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.List getList() { - if (listBuilder_ == null) { - if (dtypeTypeCase_ == 8) { - return (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 8) { - return listBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.List list = 8; - */ - public Builder setList(io.github.dfa1.vortex.proto.DTypeProtos.List value) { - if (listBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - listBuilder_.setMessage(value); - } - dtypeTypeCase_ = 8; - return this; - } - - /** - * .vortex.dtype.List list = 8; - */ - public Builder setList( - io.github.dfa1.vortex.proto.DTypeProtos.List.Builder builderForValue) { - if (listBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - listBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 8; - return this; - } - - /** - * .vortex.dtype.List list = 8; - */ - public Builder mergeList(io.github.dfa1.vortex.proto.DTypeProtos.List value) { - if (listBuilder_ == null) { - if (dtypeTypeCase_ == 8 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.List.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 8) { - listBuilder_.mergeFrom(value); - } else { - listBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 8; - return this; - } - - /** - * .vortex.dtype.List list = 8; - */ - public Builder clearList() { - if (listBuilder_ == null) { - if (dtypeTypeCase_ == 8) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 8) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - listBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.List list = 8; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.List.Builder getListBuilder() { - return internalGetListFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.List list = 8; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder getListOrBuilder() { - if ((dtypeTypeCase_ == 8) && (listBuilder_ != null)) { - return listBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 8) { - return (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.List list = 8; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.List, io.github.dfa1.vortex.proto.DTypeProtos.List.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder> - internalGetListFieldBuilder() { - if (listBuilder_ == null) { - if (!(dtypeTypeCase_ == 8)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.List.getDefaultInstance(); - } - listBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.List, io.github.dfa1.vortex.proto.DTypeProtos.List.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ListOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.List) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 8; - onChanged(); - return listBuilder_; - } - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return Whether the extension field is set. - */ - @java.lang.Override - public boolean hasExtension() { - return dtypeTypeCase_ == 9; - } - - /** - * .vortex.dtype.Extension extension = 9; - * - * @return The extension. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Extension getExtension() { - if (extensionBuilder_ == null) { - if (dtypeTypeCase_ == 9) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 9) { - return extensionBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - public Builder setExtension(io.github.dfa1.vortex.proto.DTypeProtos.Extension value) { - if (extensionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - extensionBuilder_.setMessage(value); - } - dtypeTypeCase_ = 9; - return this; - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - public Builder setExtension( - io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder builderForValue) { - if (extensionBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - extensionBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 9; - return this; - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - public Builder mergeExtension(io.github.dfa1.vortex.proto.DTypeProtos.Extension value) { - if (extensionBuilder_ == null) { - if (dtypeTypeCase_ == 9 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Extension.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 9) { - extensionBuilder_.mergeFrom(value); - } else { - extensionBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 9; - return this; - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - public Builder clearExtension() { - if (extensionBuilder_ == null) { - if (dtypeTypeCase_ == 9) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 9) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - extensionBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder getExtensionBuilder() { - return internalGetExtensionFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder getExtensionOrBuilder() { - if ((dtypeTypeCase_ == 9) && (extensionBuilder_ != null)) { - return extensionBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 9) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Extension extension = 9; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Extension, io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder> - internalGetExtensionFieldBuilder() { - if (extensionBuilder_ == null) { - if (!(dtypeTypeCase_ == 9)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Extension.getDefaultInstance(); - } - extensionBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Extension, io.github.dfa1.vortex.proto.DTypeProtos.Extension.Builder, io.github.dfa1.vortex.proto.DTypeProtos.ExtensionOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Extension) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 9; - onChanged(); - return extensionBuilder_; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return Whether the fixedSizeList field is set. - */ - @java.lang.Override - public boolean hasFixedSizeList() { - return dtypeTypeCase_ == 10; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - * - * @return The fixedSizeList. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList getFixedSizeList() { - if (fixedSizeListBuilder_ == null) { - if (dtypeTypeCase_ == 10) { - return (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 10) { - return fixedSizeListBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - public Builder setFixedSizeList(io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList value) { - if (fixedSizeListBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - fixedSizeListBuilder_.setMessage(value); - } - dtypeTypeCase_ = 10; - return this; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - public Builder setFixedSizeList( - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder builderForValue) { - if (fixedSizeListBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - fixedSizeListBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 10; - return this; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - public Builder mergeFixedSizeList(io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList value) { - if (fixedSizeListBuilder_ == null) { - if (dtypeTypeCase_ == 10 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 10) { - fixedSizeListBuilder_.mergeFrom(value); - } else { - fixedSizeListBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 10; - return this; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - public Builder clearFixedSizeList() { - if (fixedSizeListBuilder_ == null) { - if (dtypeTypeCase_ == 10) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 10) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - fixedSizeListBuilder_.clear(); - } - return this; - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder getFixedSizeListBuilder() { - return internalGetFixedSizeListFieldBuilder().getBuilder(); - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder getFixedSizeListOrBuilder() { - if ((dtypeTypeCase_ == 10) && (fixedSizeListBuilder_ != null)) { - return fixedSizeListBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 10) { - return (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - } - - /** - *
    -             * This is after `Extension` for backwards compatibility.
    -             * 
    - * - * .vortex.dtype.FixedSizeList fixed_size_list = 10; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder> - internalGetFixedSizeListFieldBuilder() { - if (fixedSizeListBuilder_ == null) { - if (!(dtypeTypeCase_ == 10)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.getDefaultInstance(); - } - fixedSizeListBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeListOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.FixedSizeList) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 10; - onChanged(); - return fixedSizeListBuilder_; - } - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return Whether the variant field is set. - */ - @java.lang.Override - public boolean hasVariant() { - return dtypeTypeCase_ == 11; - } - - /** - * .vortex.dtype.Variant variant = 11; - * - * @return The variant. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Variant getVariant() { - if (variantBuilder_ == null) { - if (dtypeTypeCase_ == 11) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 11) { - return variantBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - public Builder setVariant(io.github.dfa1.vortex.proto.DTypeProtos.Variant value) { - if (variantBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - variantBuilder_.setMessage(value); - } - dtypeTypeCase_ = 11; - return this; - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - public Builder setVariant( - io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder builderForValue) { - if (variantBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - variantBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 11; - return this; - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - public Builder mergeVariant(io.github.dfa1.vortex.proto.DTypeProtos.Variant value) { - if (variantBuilder_ == null) { - if (dtypeTypeCase_ == 11 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Variant.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 11) { - variantBuilder_.mergeFrom(value); - } else { - variantBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 11; - return this; - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - public Builder clearVariant() { - if (variantBuilder_ == null) { - if (dtypeTypeCase_ == 11) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 11) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - variantBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder getVariantBuilder() { - return internalGetVariantFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder getVariantOrBuilder() { - if ((dtypeTypeCase_ == 11) && (variantBuilder_ != null)) { - return variantBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 11) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Variant variant = 11; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Variant, io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder, io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder> - internalGetVariantFieldBuilder() { - if (variantBuilder_ == null) { - if (!(dtypeTypeCase_ == 11)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Variant.getDefaultInstance(); - } - variantBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Variant, io.github.dfa1.vortex.proto.DTypeProtos.Variant.Builder, io.github.dfa1.vortex.proto.DTypeProtos.VariantOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Variant) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 11; - onChanged(); - return variantBuilder_; - } - - /** - * .vortex.dtype.Union union = 12; - * - * @return Whether the union field is set. - */ - @java.lang.Override - public boolean hasUnion() { - return dtypeTypeCase_ == 12; - } - - /** - * .vortex.dtype.Union union = 12; - * - * @return The union. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Union getUnion() { - if (unionBuilder_ == null) { - if (dtypeTypeCase_ == 12) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } else { - if (dtypeTypeCase_ == 12) { - return unionBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Union union = 12; - */ - public Builder setUnion(io.github.dfa1.vortex.proto.DTypeProtos.Union value) { - if (unionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtypeType_ = value; - onChanged(); - } else { - unionBuilder_.setMessage(value); - } - dtypeTypeCase_ = 12; - return this; - } - - /** - * .vortex.dtype.Union union = 12; - */ - public Builder setUnion( - io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder builderForValue) { - if (unionBuilder_ == null) { - dtypeType_ = builderForValue.build(); - onChanged(); - } else { - unionBuilder_.setMessage(builderForValue.build()); - } - dtypeTypeCase_ = 12; - return this; - } - - /** - * .vortex.dtype.Union union = 12; - */ - public Builder mergeUnion(io.github.dfa1.vortex.proto.DTypeProtos.Union value) { - if (unionBuilder_ == null) { - if (dtypeTypeCase_ == 12 && - dtypeType_ != io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance()) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Union.newBuilder((io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_) - .mergeFrom(value).buildPartial(); - } else { - dtypeType_ = value; - } - onChanged(); - } else { - if (dtypeTypeCase_ == 12) { - unionBuilder_.mergeFrom(value); - } else { - unionBuilder_.setMessage(value); - } - } - dtypeTypeCase_ = 12; - return this; - } - - /** - * .vortex.dtype.Union union = 12; - */ - public Builder clearUnion() { - if (unionBuilder_ == null) { - if (dtypeTypeCase_ == 12) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - onChanged(); - } - } else { - if (dtypeTypeCase_ == 12) { - dtypeTypeCase_ = 0; - dtypeType_ = null; - } - unionBuilder_.clear(); - } - return this; - } - - /** - * .vortex.dtype.Union union = 12; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder getUnionBuilder() { - return internalGetUnionFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.Union union = 12; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder getUnionOrBuilder() { - if ((dtypeTypeCase_ == 12) && (unionBuilder_ != null)) { - return unionBuilder_.getMessageOrBuilder(); - } else { - if (dtypeTypeCase_ == 12) { - return (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_; - } - return io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - } - - /** - * .vortex.dtype.Union union = 12; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Union, io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder, io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder> - internalGetUnionFieldBuilder() { - if (unionBuilder_ == null) { - if (!(dtypeTypeCase_ == 12)) { - dtypeType_ = io.github.dfa1.vortex.proto.DTypeProtos.Union.getDefaultInstance(); - } - unionBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Union, io.github.dfa1.vortex.proto.DTypeProtos.Union.Builder, io.github.dfa1.vortex.proto.DTypeProtos.UnionOrBuilder>( - (io.github.dfa1.vortex.proto.DTypeProtos.Union) dtypeType_, - getParentForChildren(), - isClean()); - dtypeType_ = null; - } - dtypeTypeCase_ = 12; - onChanged(); - return unionBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.DType) - } - - } - - /** - * Protobuf type {@code vortex.dtype.Field} - */ - public static final class Field extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.Field) - FieldOrBuilder { - public static final int NAME_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.Field) - private static final io.github.dfa1.vortex.proto.DTypeProtos.Field DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Field parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Field"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.Field(); - } - - private int fieldTypeCase_ = 0; - @SuppressWarnings("serial") - private java.lang.Object fieldType_; - private byte memoizedIsInitialized = -1; - - // Use Field.newBuilder() to construct. - private Field(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - ; - - private Field() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.Field prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.Field getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Field.class, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder.class); - } - - public FieldTypeCase - getFieldTypeCase() { - return FieldTypeCase.forNumber( - fieldTypeCase_); - } - - /** - * string name = 1; - * - * @return Whether the name field is set. - */ - public boolean hasName() { - return fieldTypeCase_ == 1; - } - - /** - * string name = 1; - * - * @return The name. - */ - public java.lang.String getName() { - if (fieldTypeCase_ != 1) { - return ""; - } - java.lang.Object ref = fieldType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fieldType_ = s; - return s; - } - } - - /** - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - if (fieldTypeCase_ != 1) { - return com.google.protobuf.ByteString.copyFromUtf8(""); - } - java.lang.Object ref = fieldType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fieldType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (fieldTypeCase_ == 1) { - com.google.protobuf.GeneratedMessage.writeString(output, 1, fieldType_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (fieldTypeCase_ == 1) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(1, fieldType_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.Field)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.Field other = (io.github.dfa1.vortex.proto.DTypeProtos.Field) obj; - - if (!getFieldTypeCase().equals(other.getFieldTypeCase())) { - return false; - } - switch (fieldTypeCase_) { - case 1: - if (!getName() - .equals(other.getName())) { - return false; - } - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (fieldTypeCase_) { - case 1: - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Field getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - public enum FieldTypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - NAME(1), - FIELDTYPE_NOT_SET(0); - private final int value; - - private FieldTypeCase(int value) { - this.value = value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static FieldTypeCase valueOf(int value) { - return forNumber(value); - } - - public static FieldTypeCase forNumber(int value) { - switch (value) { - case 1: - return NAME; - case 0: - return FIELDTYPE_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - } - - /** - * Protobuf type {@code vortex.dtype.Field} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.Field) - io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder { - private int fieldTypeCase_ = 0; - private java.lang.Object fieldType_; - private int bitField0_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.Field.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.Field.class, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - fieldTypeCase_ = 0; - fieldType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_Field_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Field getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.Field.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Field build() { - io.github.dfa1.vortex.proto.DTypeProtos.Field result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Field buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.Field result = new io.github.dfa1.vortex.proto.DTypeProtos.Field(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.Field result) { - int from_bitField0_ = bitField0_; - } - - private void buildPartialOneofs(io.github.dfa1.vortex.proto.DTypeProtos.Field result) { - result.fieldTypeCase_ = fieldTypeCase_; - result.fieldType_ = this.fieldType_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.Field) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.Field) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.Field other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.Field.getDefaultInstance()) { - return this; - } - switch (other.getFieldTypeCase()) { - case NAME: { - fieldTypeCase_ = 1; - fieldType_ = other.fieldType_; - onChanged(); - break; - } - case FIELDTYPE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - fieldTypeCase_ = 1; - fieldType_ = input.readStringRequireUtf8(); - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - public FieldTypeCase - getFieldTypeCase() { - return FieldTypeCase.forNumber( - fieldTypeCase_); - } - - public Builder clearFieldType() { - fieldTypeCase_ = 0; - fieldType_ = null; - onChanged(); - return this; - } - - /** - * string name = 1; - * - * @return Whether the name field is set. - */ - @java.lang.Override - public boolean hasName() { - return fieldTypeCase_ == 1; - } - - /** - * string name = 1; - * - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - if (fieldTypeCase_ != 1) { - return ""; - } - java.lang.Object ref = fieldType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - fieldType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - fieldTypeCase_ = 1; - fieldType_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - * - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - if (fieldTypeCase_ != 1) { - return com.google.protobuf.ByteString.copyFromUtf8(""); - } - java.lang.Object ref = fieldType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - fieldType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - fieldTypeCase_ = 1; - fieldType_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - if (fieldTypeCase_ == 1) { - fieldTypeCase_ = 0; - fieldType_ = null; - onChanged(); - } - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.Field) - } - - } - - /** - * Protobuf type {@code vortex.dtype.FieldPath} - */ - public static final class FieldPath extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.dtype.FieldPath) - FieldPathOrBuilder { - public static final int PATH_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.dtype.FieldPath) - private static final io.github.dfa1.vortex.proto.DTypeProtos.FieldPath DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FieldPath parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "FieldPath"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.DTypeProtos.FieldPath(); - } - - @SuppressWarnings("serial") - private java.util.List path_; - private byte memoizedIsInitialized = -1; - - // Use FieldPath.newBuilder() to construct. - private FieldPath(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private FieldPath() { - path_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_descriptor; - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.DTypeProtos.FieldPath prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.DTypeProtos.FieldPath getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.class, io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.Builder.class); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - @java.lang.Override - public java.util.List getPathList() { - return path_; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - @java.lang.Override - public java.util.List - getPathOrBuilderList() { - return path_; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - @java.lang.Override - public int getPathCount() { - return path_.size(); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.Field getPath(int index) { - return path_.get(index); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder getPathOrBuilder( - int index) { - return path_.get(index); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < path_.size(); i++) { - output.writeMessage(1, path_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - - { - final int count = path_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(path_.get(i)); - } - size += 1 * count; - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.DTypeProtos.FieldPath)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.DTypeProtos.FieldPath other = (io.github.dfa1.vortex.proto.DTypeProtos.FieldPath) obj; - - if (!getPathList() - .equals(other.getPathList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPathCount() > 0) { - hash = (37 * hash) + PATH_FIELD_NUMBER; - hash = (53 * hash) + getPathList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FieldPath getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.dtype.FieldPath} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.dtype.FieldPath) - io.github.dfa1.vortex.proto.DTypeProtos.FieldPathOrBuilder { - private int bitField0_; - private java.util.List path_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Field, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder> pathBuilder_; - - // Construct using io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.class, io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - } else { - path_ = null; - pathBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.internal_static_vortex_dtype_FieldPath_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FieldPath getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FieldPath build() { - io.github.dfa1.vortex.proto.DTypeProtos.FieldPath result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.FieldPath buildPartial() { - io.github.dfa1.vortex.proto.DTypeProtos.FieldPath result = new io.github.dfa1.vortex.proto.DTypeProtos.FieldPath(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.DTypeProtos.FieldPath result) { - if (pathBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - path_ = java.util.Collections.unmodifiableList(path_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.path_ = path_; - } else { - result.path_ = pathBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.DTypeProtos.FieldPath result) { - int from_bitField0_ = bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.DTypeProtos.FieldPath) { - return mergeFrom((io.github.dfa1.vortex.proto.DTypeProtos.FieldPath) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.DTypeProtos.FieldPath other) { - if (other == io.github.dfa1.vortex.proto.DTypeProtos.FieldPath.getDefaultInstance()) { - return this; - } - if (pathBuilder_ == null) { - if (!other.path_.isEmpty()) { - if (path_.isEmpty()) { - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePathIsMutable(); - path_.addAll(other.path_); - } - onChanged(); - } - } else { - if (!other.path_.isEmpty()) { - if (pathBuilder_.isEmpty()) { - pathBuilder_.dispose(); - pathBuilder_ = null; - path_ = other.path_; - bitField0_ = (bitField0_ & ~0x00000001); - pathBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetPathFieldBuilder() : null; - } else { - pathBuilder_.addAllMessages(other.path_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - io.github.dfa1.vortex.proto.DTypeProtos.Field m = - input.readMessage( - io.github.dfa1.vortex.proto.DTypeProtos.Field.parser(), - extensionRegistry); - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(m); - } else { - pathBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private void ensurePathIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - path_ = new java.util.ArrayList(path_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public java.util.List getPathList() { - if (pathBuilder_ == null) { - return java.util.Collections.unmodifiableList(path_); - } else { - return pathBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public int getPathCount() { - if (pathBuilder_ == null) { - return path_.size(); - } else { - return pathBuilder_.getCount(); - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Field getPath(int index) { - if (pathBuilder_ == null) { - return path_.get(index); - } else { - return pathBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder setPath( - int index, io.github.dfa1.vortex.proto.DTypeProtos.Field value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.set(index, value); - onChanged(); - } else { - pathBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder setPath( - int index, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.set(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder addPath(io.github.dfa1.vortex.proto.DTypeProtos.Field value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(value); - onChanged(); - } else { - pathBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder addPath( - int index, io.github.dfa1.vortex.proto.DTypeProtos.Field value) { - if (pathBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePathIsMutable(); - path_.add(index, value); - onChanged(); - } else { - pathBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder addPath( - io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder addPath( - int index, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder builderForValue) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.add(index, builderForValue.build()); - onChanged(); - } else { - pathBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder addAllPath( - java.lang.Iterable values) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, path_); - onChanged(); - } else { - pathBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder clearPath() { - if (pathBuilder_ == null) { - path_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - pathBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public Builder removePath(int index) { - if (pathBuilder_ == null) { - ensurePathIsMutable(); - path_.remove(index); - onChanged(); - } else { - pathBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder getPathBuilder( - int index) { - return internalGetPathFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder getPathOrBuilder( - int index) { - if (pathBuilder_ == null) { - return path_.get(index); - } else { - return pathBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public java.util.List - getPathOrBuilderList() { - if (pathBuilder_ != null) { - return pathBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(path_); - } - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder addPathBuilder() { - return internalGetPathFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.DTypeProtos.Field.getDefaultInstance()); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder addPathBuilder( - int index) { - return internalGetPathFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.DTypeProtos.Field.getDefaultInstance()); - } - - /** - * repeated .vortex.dtype.Field path = 1; - */ - public java.util.List - getPathBuilderList() { - return internalGetPathFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Field, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder> - internalGetPathFieldBuilder() { - if (pathBuilder_ == null) { - pathBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.Field, io.github.dfa1.vortex.proto.DTypeProtos.Field.Builder, io.github.dfa1.vortex.proto.DTypeProtos.FieldOrBuilder>( - path_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - path_ = null; - } - return pathBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.dtype.FieldPath) - } - - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DateTimePartsMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/DateTimePartsMetadata.java new file mode 100644 index 00000000..33641dd6 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DateTimePartsMetadata.java @@ -0,0 +1,81 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.DateTimePartsMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param days_ptype field tag 1 +/// @param seconds_ptype field tag 2 +/// @param subseconds_ptype field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DateTimePartsMetadata( + PType days_ptype, + PType seconds_ptype, + PType subseconds_ptype +) { + + /// Decodes a {@code vortex.encodings.DateTimePartsMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DateTimePartsMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType days_ptype = PType.U8; + PType seconds_ptype = PType.U8; + PType subseconds_ptype = PType.U8; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + days_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 2 -> { + int __ev = r.readVarint32(); + try { + seconds_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 3 -> { + int __ev = r.readVarint32(); + try { + subseconds_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + default -> r.skipField(tag & 7); + } + } + return new DateTimePartsMetadata(days_ptype, seconds_ptype, subseconds_ptype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (days_ptype.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(days_ptype.value()); + } + if (seconds_ptype.value() != 0) { + w.writeTag(2, 0); + w.writeVarint32(seconds_ptype.value()); + } + if (subseconds_ptype.value() != 0) { + w.writeTag(3, 0); + w.writeVarint32(subseconds_ptype.value()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Decimal.java b/core/src/main/java/io/github/dfa1/vortex/proto/Decimal.java new file mode 100644 index 00000000..aaac43f0 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Decimal.java @@ -0,0 +1,66 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Decimal}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param precision field tag 1 +/// @param scale field tag 2 +/// @param nullable field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Decimal( + int precision, + int scale, + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Decimal} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Decimal decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int precision = 0; + int scale = 0; + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + precision = r.readVarint32(); + } + case 2 -> { + scale = r.readVarint32(); + } + case 3 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Decimal(precision, scale, nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (precision != 0) { + w.writeTag(1, 0); + w.writeVarint32(precision); + } + if (scale != 0) { + w.writeTag(2, 0); + w.writeVarint32(scale); + } + if (nullable) { + w.writeTag(3, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DecimalBytePartsMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/DecimalBytePartsMetadata.java new file mode 100644 index 00000000..2a9d7ae8 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DecimalBytePartsMetadata.java @@ -0,0 +1,61 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.DecimalBytePartsMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param zeroth_child_ptype field tag 1 +/// @param lower_part_count field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DecimalBytePartsMetadata( + PType zeroth_child_ptype, + int lower_part_count +) { + + /// Decodes a {@code vortex.encodings.DecimalBytePartsMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DecimalBytePartsMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType zeroth_child_ptype = PType.U8; + int lower_part_count = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + zeroth_child_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 2 -> { + lower_part_count = r.readVarint32(); + } + default -> r.skipField(tag & 7); + } + } + return new DecimalBytePartsMetadata(zeroth_child_ptype, lower_part_count); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (zeroth_child_ptype.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(zeroth_child_ptype.value()); + } + if (lower_part_count != 0) { + w.writeTag(2, 0); + w.writeVarint32(lower_part_count); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DecimalMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/DecimalMetadata.java new file mode 100644 index 00000000..a8089737 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DecimalMetadata.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.DecimalMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param values_type field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DecimalMetadata( + int values_type +) { + + /// Decodes a {@code vortex.encodings.DecimalMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DecimalMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int values_type = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + values_type = r.readVarint32(); + } + default -> r.skipField(tag & 7); + } + } + return new DecimalMetadata(values_type); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (values_type != 0) { + w.writeTag(1, 0); + w.writeVarint32(values_type); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DeltaMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/DeltaMetadata.java new file mode 100644 index 00000000..e3672abf --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DeltaMetadata.java @@ -0,0 +1,56 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.DeltaMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param deltas_len field tag 1 +/// @param offset field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DeltaMetadata( + long deltas_len, + int offset +) { + + /// Decodes a {@code vortex.encodings.DeltaMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DeltaMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long deltas_len = 0; + int offset = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + deltas_len = r.readVarint64(); + } + case 2 -> { + offset = r.readVarint32(); + } + default -> r.skipField(tag & 7); + } + } + return new DeltaMetadata(deltas_len, offset); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (deltas_len != 0L) { + w.writeTag(1, 0); + w.writeVarint64(deltas_len); + } + if (offset != 0) { + w.writeTag(2, 0); + w.writeVarint32(offset); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/DictMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/DictMetadata.java new file mode 100644 index 00000000..183f734b --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/DictMetadata.java @@ -0,0 +1,81 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.DictMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param values_len field tag 1 +/// @param codes_ptype field tag 2 +/// @param is_nullable_codes field tag 3 +/// @param all_values_referenced field tag 4 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record DictMetadata( + int values_len, + PType codes_ptype, + Boolean is_nullable_codes, + Boolean all_values_referenced +) { + + /// Decodes a {@code vortex.encodings.DictMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static DictMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int values_len = 0; + PType codes_ptype = PType.U8; + Boolean is_nullable_codes = null; + Boolean all_values_referenced = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + values_len = r.readVarint32(); + } + case 2 -> { + int __ev = r.readVarint32(); + try { + codes_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 3 -> { + is_nullable_codes = r.readBool(); + } + case 4 -> { + all_values_referenced = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new DictMetadata(values_len, codes_ptype, is_nullable_codes, all_values_referenced); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (values_len != 0) { + w.writeTag(1, 0); + w.writeVarint32(values_len); + } + if (codes_ptype.value() != 0) { + w.writeTag(2, 0); + w.writeVarint32(codes_ptype.value()); + } + if (is_nullable_codes != null) { + w.writeTag(3, 0); + w.writeBool(is_nullable_codes); + } + if (all_values_referenced != null) { + w.writeTag(4, 0); + w.writeBool(all_values_referenced); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/EncodingProtos.java b/core/src/main/java/io/github/dfa1/vortex/proto/EncodingProtos.java deleted file mode 100644 index 265922e2..00000000 --- a/core/src/main/java/io/github/dfa1/vortex/proto/EncodingProtos.java +++ /dev/null @@ -1,16916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: encodings.proto -// Protobuf Java Version: 4.35.0 - -package io.github.dfa1.vortex.proto; - -@com.google.protobuf.Generated -public final class EncodingProtos extends com.google.protobuf.GeneratedFile { - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_PatchesMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_PatchesMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_SparseMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_SparseMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_DictMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_DictMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_RunEndMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_RunEndMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ALPMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ALPMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_BitPackedMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_BitPackedMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_SequenceMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_SequenceMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_VarBinMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_VarBinMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_FSSTMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_FSSTMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_DeltaMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_DeltaMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_DecimalMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_DecimalMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_DecimalBytePartsMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_DateTimePartsMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_DateTimePartsMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ZstdFrameMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ZstdFrameMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ZstdMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ZstdMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_RLEMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_RLEMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ListMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ListMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ListViewMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ListViewMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_ALPRDMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_ALPRDMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_PcoPageInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_PcoPageInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_PcoChunkInfo_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_PcoChunkInfo_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_encodings_PcoMetadata_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_encodings_PcoMetadata_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.FileDescriptor - descriptor; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "EncodingProtos"); - } - - static { - java.lang.String[] descriptorData = { - "\n\017encodings.proto\022\020vortex.encodings\032\014sca" + - "lar.proto\032\013dtype.proto\"\231\002\n\017PatchesMetada" + - "ta\022\013\n\003len\030\001 \001(\004\022\016\n\006offset\030\002 \001(\004\022*\n\rindic" + - "es_ptype\030\003 \001(\0162\023.vortex.dtype.PType\022\036\n\021c" + - "hunk_offsets_len\030\004 \001(\004H\000\210\001\001\0225\n\023chunk_off" + - "sets_ptype\030\005 \001(\0162\023.vortex.dtype.PTypeH\001\210" + - "\001\001\022 \n\023offset_within_chunk\030\006 \001(\004H\002\210\001\001B\024\n\022" + - "_chunk_offsets_lenB\026\n\024_chunk_offsets_pty" + - "peB\026\n\024_offset_within_chunk\"D\n\016SparseMeta" + - "data\0222\n\007patches\030\001 \001(\0132!.vortex.encodings" + - ".PatchesMetadata\"\300\001\n\014DictMetadata\022\022\n\nval" + - "ues_len\030\001 \001(\r\022(\n\013codes_ptype\030\002 \001(\0162\023.vor" + - "tex.dtype.PType\022\036\n\021is_nullable_codes\030\003 \001" + - "(\010H\000\210\001\001\022\"\n\025all_values_referenced\030\004 \001(\010H\001" + - "\210\001\001B\024\n\022_is_nullable_codesB\030\n\026_all_values" + - "_referenced\"[\n\016RunEndMetadata\022\'\n\nends_pt" + - "ype\030\001 \001(\0162\023.vortex.dtype.PType\022\020\n\010num_ru" + - "ns\030\002 \001(\004\022\016\n\006offset\030\003 \001(\004\"p\n\013ALPMetadata\022" + - "\r\n\005exp_e\030\001 \001(\r\022\r\n\005exp_f\030\002 \001(\r\0227\n\007patches" + - "\030\003 \001(\0132!.vortex.encodings.PatchesMetadat" + - "aH\000\210\001\001B\n\n\010_patches\"{\n\021BitPackedMetadata\022" + - "\021\n\tbit_width\030\001 \001(\r\022\016\n\006offset\030\002 \001(\r\0227\n\007pa" + - "tches\030\003 \001(\0132!.vortex.encodings.PatchesMe" + - "tadataH\000\210\001\001B\n\n\010_patches\"l\n\020SequenceMetad" + - "ata\022(\n\004base\030\001 \001(\0132\032.vortex.scalar.Scalar" + - "Value\022.\n\nmultiplier\030\002 \001(\0132\032.vortex.scala" + - "r.ScalarValue\"<\n\016VarBinMetadata\022*\n\roffse" + - "ts_ptype\030\001 \001(\0162\023.vortex.dtype.PType\"y\n\014F" + - "SSTMetadata\0227\n\032uncompressed_lengths_ptyp" + - "e\030\001 \001(\0162\023.vortex.dtype.PType\0220\n\023codes_of" + - "fsets_ptype\030\002 \001(\0162\023.vortex.dtype.PType\"3" + - "\n\rDeltaMetadata\022\022\n\ndeltas_len\030\001 \001(\004\022\016\n\006o" + - "ffset\030\002 \001(\r\"&\n\017DecimalMetadata\022\023\n\013values" + - "_type\030\001 \001(\005\"e\n\030DecimalBytePartsMetadata\022" + - "/\n\022zeroth_child_ptype\030\001 \001(\0162\023.vortex.dty" + - "pe.PType\022\030\n\020lower_part_count\030\002 \001(\r\"\233\001\n\025D" + - "ateTimePartsMetadata\022\'\n\ndays_ptype\030\001 \001(\016" + - "2\023.vortex.dtype.PType\022*\n\rseconds_ptype\030\002" + - " \001(\0162\023.vortex.dtype.PType\022-\n\020subseconds_" + - "ptype\030\003 \001(\0162\023.vortex.dtype.PType\"@\n\021Zstd" + - "FrameMetadata\022\031\n\021uncompressed_size\030\001 \001(\004" + - "\022\020\n\010n_values\030\002 \001(\004\"\\\n\014ZstdMetadata\022\027\n\017di" + - "ctionary_size\030\001 \001(\r\0223\n\006frames\030\002 \003(\0132#.vo" + - "rtex.encodings.ZstdFrameMetadata\"\311\001\n\013RLE" + - "Metadata\022\022\n\nvalues_len\030\001 \001(\004\022\023\n\013indices_" + - "len\030\002 \001(\004\022*\n\rindices_ptype\030\003 \001(\0162\023.vorte" + - "x.dtype.PType\022\036\n\026values_idx_offsets_len\030" + - "\004 \001(\004\0225\n\030values_idx_offsets_ptype\030\005 \001(\0162" + - "\023.vortex.dtype.PType\022\016\n\006offset\030\006 \001(\004\"O\n\014" + - "ListMetadata\022\024\n\014elements_len\030\001 \001(\004\022)\n\014of" + - "fset_ptype\030\002 \001(\0162\023.vortex.dtype.PType\"|\n" + - "\020ListViewMetadata\022\024\n\014elements_len\030\001 \001(\004\022" + - ")\n\014offset_ptype\030\002 \001(\0162\023.vortex.dtype.PTy" + - "pe\022\'\n\nsize_ptype\030\003 \001(\0162\023.vortex.dtype.PT" + - "ype\"\274\001\n\rALPRDMetadata\022\027\n\017right_bit_width" + - "\030\001 \001(\r\022\020\n\010dict_len\030\002 \001(\r\022\014\n\004dict\030\003 \003(\r\022-" + - "\n\020left_parts_ptype\030\004 \001(\0162\023.vortex.dtype." + - "PType\0227\n\007patches\030\005 \001(\0132!.vortex.encoding" + - "s.PatchesMetadataH\000\210\001\001B\n\n\010_patches\"\037\n\013Pc" + - "oPageInfo\022\020\n\010n_values\030\001 \001(\r\"<\n\014PcoChunkI" + - "nfo\022,\n\005pages\030\001 \003(\0132\035.vortex.encodings.Pc" + - "oPageInfo\"M\n\013PcoMetadata\022\016\n\006header\030\001 \001(\014" + - "\022.\n\006chunks\030\002 \003(\0132\036.vortex.encodings.PcoC" + - "hunkInfoB-\n\033io.github.dfa1.vortex.protoB" + - "\016EncodingProtosb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - io.github.dfa1.vortex.proto.ScalarProtos.getDescriptor(), - io.github.dfa1.vortex.proto.DTypeProtos.getDescriptor(), - }); - internal_static_vortex_encodings_PatchesMetadata_descriptor = - getDescriptor().getMessageType(0); - internal_static_vortex_encodings_PatchesMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_PatchesMetadata_descriptor, - new java.lang.String[]{"Len", "Offset", "IndicesPtype", "ChunkOffsetsLen", "ChunkOffsetsPtype", "OffsetWithinChunk",}); - internal_static_vortex_encodings_SparseMetadata_descriptor = - getDescriptor().getMessageType(1); - internal_static_vortex_encodings_SparseMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_SparseMetadata_descriptor, - new java.lang.String[]{"Patches",}); - internal_static_vortex_encodings_DictMetadata_descriptor = - getDescriptor().getMessageType(2); - internal_static_vortex_encodings_DictMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_DictMetadata_descriptor, - new java.lang.String[]{"ValuesLen", "CodesPtype", "IsNullableCodes", "AllValuesReferenced",}); - internal_static_vortex_encodings_RunEndMetadata_descriptor = - getDescriptor().getMessageType(3); - internal_static_vortex_encodings_RunEndMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_RunEndMetadata_descriptor, - new java.lang.String[]{"EndsPtype", "NumRuns", "Offset",}); - internal_static_vortex_encodings_ALPMetadata_descriptor = - getDescriptor().getMessageType(4); - internal_static_vortex_encodings_ALPMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ALPMetadata_descriptor, - new java.lang.String[]{"ExpE", "ExpF", "Patches",}); - internal_static_vortex_encodings_BitPackedMetadata_descriptor = - getDescriptor().getMessageType(5); - internal_static_vortex_encodings_BitPackedMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_BitPackedMetadata_descriptor, - new java.lang.String[]{"BitWidth", "Offset", "Patches",}); - internal_static_vortex_encodings_SequenceMetadata_descriptor = - getDescriptor().getMessageType(6); - internal_static_vortex_encodings_SequenceMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_SequenceMetadata_descriptor, - new java.lang.String[]{"Base", "Multiplier",}); - internal_static_vortex_encodings_VarBinMetadata_descriptor = - getDescriptor().getMessageType(7); - internal_static_vortex_encodings_VarBinMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_VarBinMetadata_descriptor, - new java.lang.String[]{"OffsetsPtype",}); - internal_static_vortex_encodings_FSSTMetadata_descriptor = - getDescriptor().getMessageType(8); - internal_static_vortex_encodings_FSSTMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_FSSTMetadata_descriptor, - new java.lang.String[]{"UncompressedLengthsPtype", "CodesOffsetsPtype",}); - internal_static_vortex_encodings_DeltaMetadata_descriptor = - getDescriptor().getMessageType(9); - internal_static_vortex_encodings_DeltaMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_DeltaMetadata_descriptor, - new java.lang.String[]{"DeltasLen", "Offset",}); - internal_static_vortex_encodings_DecimalMetadata_descriptor = - getDescriptor().getMessageType(10); - internal_static_vortex_encodings_DecimalMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_DecimalMetadata_descriptor, - new java.lang.String[]{"ValuesType",}); - internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor = - getDescriptor().getMessageType(11); - internal_static_vortex_encodings_DecimalBytePartsMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor, - new java.lang.String[]{"ZerothChildPtype", "LowerPartCount",}); - internal_static_vortex_encodings_DateTimePartsMetadata_descriptor = - getDescriptor().getMessageType(12); - internal_static_vortex_encodings_DateTimePartsMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_DateTimePartsMetadata_descriptor, - new java.lang.String[]{"DaysPtype", "SecondsPtype", "SubsecondsPtype",}); - internal_static_vortex_encodings_ZstdFrameMetadata_descriptor = - getDescriptor().getMessageType(13); - internal_static_vortex_encodings_ZstdFrameMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ZstdFrameMetadata_descriptor, - new java.lang.String[]{"UncompressedSize", "NValues",}); - internal_static_vortex_encodings_ZstdMetadata_descriptor = - getDescriptor().getMessageType(14); - internal_static_vortex_encodings_ZstdMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ZstdMetadata_descriptor, - new java.lang.String[]{"DictionarySize", "Frames",}); - internal_static_vortex_encodings_RLEMetadata_descriptor = - getDescriptor().getMessageType(15); - internal_static_vortex_encodings_RLEMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_RLEMetadata_descriptor, - new java.lang.String[]{"ValuesLen", "IndicesLen", "IndicesPtype", "ValuesIdxOffsetsLen", "ValuesIdxOffsetsPtype", "Offset",}); - internal_static_vortex_encodings_ListMetadata_descriptor = - getDescriptor().getMessageType(16); - internal_static_vortex_encodings_ListMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ListMetadata_descriptor, - new java.lang.String[]{"ElementsLen", "OffsetPtype",}); - internal_static_vortex_encodings_ListViewMetadata_descriptor = - getDescriptor().getMessageType(17); - internal_static_vortex_encodings_ListViewMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ListViewMetadata_descriptor, - new java.lang.String[]{"ElementsLen", "OffsetPtype", "SizePtype",}); - internal_static_vortex_encodings_ALPRDMetadata_descriptor = - getDescriptor().getMessageType(18); - internal_static_vortex_encodings_ALPRDMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_ALPRDMetadata_descriptor, - new java.lang.String[]{"RightBitWidth", "DictLen", "Dict", "LeftPartsPtype", "Patches",}); - internal_static_vortex_encodings_PcoPageInfo_descriptor = - getDescriptor().getMessageType(19); - internal_static_vortex_encodings_PcoPageInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_PcoPageInfo_descriptor, - new java.lang.String[]{"NValues",}); - internal_static_vortex_encodings_PcoChunkInfo_descriptor = - getDescriptor().getMessageType(20); - internal_static_vortex_encodings_PcoChunkInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_PcoChunkInfo_descriptor, - new java.lang.String[]{"Pages",}); - internal_static_vortex_encodings_PcoMetadata_descriptor = - getDescriptor().getMessageType(21); - internal_static_vortex_encodings_PcoMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_encodings_PcoMetadata_descriptor, - new java.lang.String[]{"Header", "Chunks",}); - descriptor.resolveAllFeaturesImmutable(); - io.github.dfa1.vortex.proto.ScalarProtos.getDescriptor(); - io.github.dfa1.vortex.proto.DTypeProtos.getDescriptor(); - } - - private EncodingProtos() { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - - public interface PatchesMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.PatchesMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 len = 1; - * - * @return The len. - */ - long getLen(); - - /** - * uint64 offset = 2; - * - * @return The offset. - */ - long getOffset(); - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - int getIndicesPtypeValue(); - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype(); - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return Whether the chunkOffsetsLen field is set. - */ - boolean hasChunkOffsetsLen(); - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return The chunkOffsetsLen. - */ - long getChunkOffsetsLen(); - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return Whether the chunkOffsetsPtype field is set. - */ - boolean hasChunkOffsetsPtype(); - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for chunkOffsetsPtype. - */ - int getChunkOffsetsPtypeValue(); - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The chunkOffsetsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getChunkOffsetsPtype(); - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return Whether the offsetWithinChunk field is set. - */ - boolean hasOffsetWithinChunk(); - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return The offsetWithinChunk. - */ - long getOffsetWithinChunk(); - } - - public interface SparseMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.SparseMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return Whether the patches field is set. - */ - boolean hasPatches(); - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return The patches. - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches(); - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder(); - } - - public interface DictMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.DictMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 values_len = 1; - * - * @return The valuesLen. - */ - int getValuesLen(); - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The enum numeric value on the wire for codesPtype. - */ - int getCodesPtypeValue(); - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The codesPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesPtype(); - - /** - * optional bool is_nullable_codes = 3; - * - * @return Whether the isNullableCodes field is set. - */ - boolean hasIsNullableCodes(); - - /** - * optional bool is_nullable_codes = 3; - * - * @return The isNullableCodes. - */ - boolean getIsNullableCodes(); - - /** - * optional bool all_values_referenced = 4; - * - * @return Whether the allValuesReferenced field is set. - */ - boolean hasAllValuesReferenced(); - - /** - * optional bool all_values_referenced = 4; - * - * @return The allValuesReferenced. - */ - boolean getAllValuesReferenced(); - } - - public interface RunEndMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.RunEndMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The enum numeric value on the wire for endsPtype. - */ - int getEndsPtypeValue(); - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The endsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getEndsPtype(); - - /** - * uint64 num_runs = 2; - * - * @return The numRuns. - */ - long getNumRuns(); - - /** - * uint64 offset = 3; - * - * @return The offset. - */ - long getOffset(); - } - - public interface ALPMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ALPMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 exp_e = 1; - * - * @return The expE. - */ - int getExpE(); - - /** - * uint32 exp_f = 2; - * - * @return The expF. - */ - int getExpF(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - boolean hasPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder(); - } - - public interface BitPackedMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.BitPackedMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 bit_width = 1; - * - * @return The bitWidth. - */ - int getBitWidth(); - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - int getOffset(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - boolean hasPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder(); - } - - public interface SequenceMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.SequenceMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return Whether the base field is set. - */ - boolean hasBase(); - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return The base. - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getBase(); - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getBaseOrBuilder(); - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return Whether the multiplier field is set. - */ - boolean hasMultiplier(); - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return The multiplier. - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getMultiplier(); - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getMultiplierOrBuilder(); - } - - public interface VarBinMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.VarBinMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The enum numeric value on the wire for offsetsPtype. - */ - int getOffsetsPtypeValue(); - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The offsetsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetsPtype(); - } - - public interface FSSTMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.FSSTMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The enum numeric value on the wire for uncompressedLengthsPtype. - */ - int getUncompressedLengthsPtypeValue(); - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The uncompressedLengthsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getUncompressedLengthsPtype(); - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The enum numeric value on the wire for codesOffsetsPtype. - */ - int getCodesOffsetsPtypeValue(); - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The codesOffsetsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesOffsetsPtype(); - } - - public interface DeltaMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.DeltaMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 deltas_len = 1; - * - * @return The deltasLen. - */ - long getDeltasLen(); - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - int getOffset(); - } - - public interface DecimalMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.DecimalMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
    -         * DecimalType: I8=0, I16=1, I32=2, I64=3, I128=4, I256=5
    -         * 
    - * - * int32 values_type = 1; - * - * @return The valuesType. - */ - int getValuesType(); - } - - public interface DecimalBytePartsMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.DecimalBytePartsMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The enum numeric value on the wire for zerothChildPtype. - */ - int getZerothChildPtypeValue(); - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The zerothChildPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getZerothChildPtype(); - - /** - * uint32 lower_part_count = 2; - * - * @return The lowerPartCount. - */ - int getLowerPartCount(); - } - - public interface DateTimePartsMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.DateTimePartsMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The enum numeric value on the wire for daysPtype. - */ - int getDaysPtypeValue(); - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The daysPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getDaysPtype(); - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The enum numeric value on the wire for secondsPtype. - */ - int getSecondsPtypeValue(); - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The secondsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getSecondsPtype(); - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The enum numeric value on the wire for subsecondsPtype. - */ - int getSubsecondsPtypeValue(); - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The subsecondsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getSubsecondsPtype(); - } - - public interface ZstdFrameMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ZstdFrameMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 uncompressed_size = 1; - * - * @return The uncompressedSize. - */ - long getUncompressedSize(); - - /** - * uint64 n_values = 2; - * - * @return The nValues. - */ - long getNValues(); - } - - public interface ZstdMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ZstdMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 dictionary_size = 1; - * - * @return The dictionarySize. - */ - int getDictionarySize(); - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - java.util.List - getFramesList(); - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getFrames(int index); - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - int getFramesCount(); - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - java.util.List - getFramesOrBuilderList(); - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder getFramesOrBuilder( - int index); - } - - public interface RLEMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.RLEMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 values_len = 1; - * - * @return The valuesLen. - */ - long getValuesLen(); - - /** - * uint64 indices_len = 2; - * - * @return The indicesLen. - */ - long getIndicesLen(); - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - int getIndicesPtypeValue(); - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype(); - - /** - * uint64 values_idx_offsets_len = 4; - * - * @return The valuesIdxOffsetsLen. - */ - long getValuesIdxOffsetsLen(); - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for valuesIdxOffsetsPtype. - */ - int getValuesIdxOffsetsPtypeValue(); - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The valuesIdxOffsetsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getValuesIdxOffsetsPtype(); - - /** - * uint64 offset = 6; - * - * @return The offset. - */ - long getOffset(); - } - - public interface ListMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ListMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - long getElementsLen(); - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - int getOffsetPtypeValue(); - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype(); - } - - public interface ListViewMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ListViewMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - long getElementsLen(); - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - int getOffsetPtypeValue(); - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype(); - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The enum numeric value on the wire for sizePtype. - */ - int getSizePtypeValue(); - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The sizePtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getSizePtype(); - } - - public interface ALPRDMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.ALPRDMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 right_bit_width = 1; - * - * @return The rightBitWidth. - */ - int getRightBitWidth(); - - /** - * uint32 dict_len = 2; - * - * @return The dictLen. - */ - int getDictLen(); - - /** - * repeated uint32 dict = 3; - * - * @return A list containing the dict. - */ - java.util.List getDictList(); - - /** - * repeated uint32 dict = 3; - * - * @return The count of dict. - */ - int getDictCount(); - - /** - * repeated uint32 dict = 3; - * - * @param index The index of the element to return. - * @return The dict at the given index. - */ - int getDict(int index); - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The enum numeric value on the wire for leftPartsPtype. - */ - int getLeftPartsPtypeValue(); - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The leftPartsPtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.PType getLeftPartsPtype(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return Whether the patches field is set. - */ - boolean hasPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return The patches. - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches(); - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder(); - } - - public interface PcoPageInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.PcoPageInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * uint32 n_values = 1; - * - * @return The nValues. - */ - int getNValues(); - } - - public interface PcoChunkInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.PcoChunkInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - java.util.List - getPagesList(); - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getPages(int index); - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - int getPagesCount(); - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - java.util.List - getPagesOrBuilderList(); - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder getPagesOrBuilder( - int index); - } - - public interface PcoMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.encodings.PcoMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - * bytes header = 1; - * - * @return The header. - */ - com.google.protobuf.ByteString getHeader(); - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - java.util.List - getChunksList(); - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getChunks(int index); - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - int getChunksCount(); - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - java.util.List - getChunksOrBuilderList(); - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder getChunksOrBuilder( - int index); - } - - /** - * Protobuf type {@code vortex.encodings.PatchesMetadata} - */ - public static final class PatchesMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.PatchesMetadata) - PatchesMetadataOrBuilder { - public static final int LEN_FIELD_NUMBER = 1; - public static final int OFFSET_FIELD_NUMBER = 2; - public static final int INDICES_PTYPE_FIELD_NUMBER = 3; - public static final int CHUNK_OFFSETS_LEN_FIELD_NUMBER = 4; - public static final int CHUNK_OFFSETS_PTYPE_FIELD_NUMBER = 5; - public static final int OFFSET_WITHIN_CHUNK_FIELD_NUMBER = 6; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.PatchesMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PatchesMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "PatchesMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata(); - } - - private int bitField0_; - private long len_ = 0L; - private long offset_ = 0L; - private int indicesPtype_ = 0; - private long chunkOffsetsLen_ = 0L; - private int chunkOffsetsPtype_ = 0; - private long offsetWithinChunk_ = 0L; - private byte memoizedIsInitialized = -1; - - // Use PatchesMetadata.newBuilder() to construct. - private PatchesMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private PatchesMetadata() { - indicesPtype_ = 0; - chunkOffsetsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder.class); - } - - /** - * uint64 len = 1; - * - * @return The len. - */ - @java.lang.Override - public long getLen() { - return len_; - } - - /** - * uint64 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - @java.lang.Override - public int getIndicesPtypeValue() { - return indicesPtype_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(indicesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return Whether the chunkOffsetsLen field is set. - */ - @java.lang.Override - public boolean hasChunkOffsetsLen() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return The chunkOffsetsLen. - */ - @java.lang.Override - public long getChunkOffsetsLen() { - return chunkOffsetsLen_; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return Whether the chunkOffsetsPtype field is set. - */ - @java.lang.Override - public boolean hasChunkOffsetsPtype() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for chunkOffsetsPtype. - */ - @java.lang.Override - public int getChunkOffsetsPtypeValue() { - return chunkOffsetsPtype_; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The chunkOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getChunkOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(chunkOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return Whether the offsetWithinChunk field is set. - */ - @java.lang.Override - public boolean hasOffsetWithinChunk() { - return ((bitField0_ & 0x00000004) != 0); - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return The offsetWithinChunk. - */ - @java.lang.Override - public long getOffsetWithinChunk() { - return offsetWithinChunk_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (len_ != 0L) { - output.writeUInt64(1, len_); - } - if (offset_ != 0L) { - output.writeUInt64(2, offset_); - } - if (indicesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(3, indicesPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeUInt64(4, chunkOffsetsLen_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeEnum(5, chunkOffsetsPtype_); - } - if (((bitField0_ & 0x00000004) != 0)) { - output.writeUInt64(6, offsetWithinChunk_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (len_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, len_); - } - if (offset_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, offset_); - } - if (indicesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, indicesPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, chunkOffsetsLen_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, chunkOffsetsPtype_); - } - if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, offsetWithinChunk_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata) obj; - - if (getLen() - != other.getLen()) { - return false; - } - if (getOffset() - != other.getOffset()) { - return false; - } - if (indicesPtype_ != other.indicesPtype_) { - return false; - } - if (hasChunkOffsetsLen() != other.hasChunkOffsetsLen()) { - return false; - } - if (hasChunkOffsetsLen()) { - if (getChunkOffsetsLen() - != other.getChunkOffsetsLen()) { - return false; - } - } - if (hasChunkOffsetsPtype() != other.hasChunkOffsetsPtype()) { - return false; - } - if (hasChunkOffsetsPtype()) { - if (chunkOffsetsPtype_ != other.chunkOffsetsPtype_) { - return false; - } - } - if (hasOffsetWithinChunk() != other.hasOffsetWithinChunk()) { - return false; - } - if (hasOffsetWithinChunk()) { - if (getOffsetWithinChunk() - != other.getOffsetWithinChunk()) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLen()); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffset()); - hash = (37 * hash) + INDICES_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + indicesPtype_; - if (hasChunkOffsetsLen()) { - hash = (37 * hash) + CHUNK_OFFSETS_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getChunkOffsetsLen()); - } - if (hasChunkOffsetsPtype()) { - hash = (37 * hash) + CHUNK_OFFSETS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + chunkOffsetsPtype_; - } - if (hasOffsetWithinChunk()) { - hash = (37 * hash) + OFFSET_WITHIN_CHUNK_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffsetWithinChunk()); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.PatchesMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.PatchesMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder { - private int bitField0_; - private long len_; - private long offset_; - private int indicesPtype_ = 0; - private long chunkOffsetsLen_; - private int chunkOffsetsPtype_ = 0; - private long offsetWithinChunk_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - len_ = 0L; - offset_ = 0L; - indicesPtype_ = 0; - chunkOffsetsLen_ = 0L; - chunkOffsetsPtype_ = 0; - offsetWithinChunk_ = 0L; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PatchesMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.len_ = len_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.offset_ = offset_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.indicesPtype_ = indicesPtype_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000008) != 0)) { - result.chunkOffsetsLen_ = chunkOffsetsLen_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.chunkOffsetsPtype_ = chunkOffsetsPtype_; - to_bitField0_ |= 0x00000002; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.offsetWithinChunk_ = offsetWithinChunk_; - to_bitField0_ |= 0x00000004; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance()) { - return this; - } - if (other.getLen() != 0L) { - setLen(other.getLen()); - } - if (other.getOffset() != 0L) { - setOffset(other.getOffset()); - } - if (other.indicesPtype_ != 0) { - setIndicesPtypeValue(other.getIndicesPtypeValue()); - } - if (other.hasChunkOffsetsLen()) { - setChunkOffsetsLen(other.getChunkOffsetsLen()); - } - if (other.hasChunkOffsetsPtype()) { - setChunkOffsetsPtypeValue(other.getChunkOffsetsPtypeValue()); - } - if (other.hasOffsetWithinChunk()) { - setOffsetWithinChunk(other.getOffsetWithinChunk()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - len_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - offset_ = input.readUInt64(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - indicesPtype_ = input.readEnum(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 32: { - chunkOffsetsLen_ = input.readUInt64(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 40: { - chunkOffsetsPtype_ = input.readEnum(); - bitField0_ |= 0x00000010; - break; - } // case 40 - case 48: { - offsetWithinChunk_ = input.readUInt64(); - bitField0_ |= 0x00000020; - break; - } // case 48 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 len = 1; - * - * @return The len. - */ - @java.lang.Override - public long getLen() { - return len_; - } - - /** - * uint64 len = 1; - * - * @param value The len to set. - * @return This builder for chaining. - */ - public Builder setLen(long value) { - - len_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 len = 1; - * - * @return This builder for chaining. - */ - public Builder clearLen() { - bitField0_ = (bitField0_ & ~0x00000001); - len_ = 0L; - onChanged(); - return this; - } - - /** - * uint64 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - /** - * uint64 offset = 2; - * - * @param value The offset to set. - * @return This builder for chaining. - */ - public Builder setOffset(long value) { - - offset_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint64 offset = 2; - * - * @return This builder for chaining. - */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000002); - offset_ = 0L; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - @java.lang.Override - public int getIndicesPtypeValue() { - return indicesPtype_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @param value The enum numeric value on the wire for indicesPtype to set. - * @return This builder for chaining. - */ - public Builder setIndicesPtypeValue(int value) { - indicesPtype_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(indicesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @param value The indicesPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setIndicesPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - indicesPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return This builder for chaining. - */ - public Builder clearIndicesPtype() { - bitField0_ = (bitField0_ & ~0x00000004); - indicesPtype_ = 0; - onChanged(); - return this; - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return Whether the chunkOffsetsLen field is set. - */ - @java.lang.Override - public boolean hasChunkOffsetsLen() { - return ((bitField0_ & 0x00000008) != 0); - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return The chunkOffsetsLen. - */ - @java.lang.Override - public long getChunkOffsetsLen() { - return chunkOffsetsLen_; - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @param value The chunkOffsetsLen to set. - * @return This builder for chaining. - */ - public Builder setChunkOffsetsLen(long value) { - - chunkOffsetsLen_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - /** - * optional uint64 chunk_offsets_len = 4; - * - * @return This builder for chaining. - */ - public Builder clearChunkOffsetsLen() { - bitField0_ = (bitField0_ & ~0x00000008); - chunkOffsetsLen_ = 0L; - onChanged(); - return this; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return Whether the chunkOffsetsPtype field is set. - */ - @java.lang.Override - public boolean hasChunkOffsetsPtype() { - return ((bitField0_ & 0x00000010) != 0); - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for chunkOffsetsPtype. - */ - @java.lang.Override - public int getChunkOffsetsPtypeValue() { - return chunkOffsetsPtype_; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @param value The enum numeric value on the wire for chunkOffsetsPtype to set. - * @return This builder for chaining. - */ - public Builder setChunkOffsetsPtypeValue(int value) { - chunkOffsetsPtype_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return The chunkOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getChunkOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(chunkOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @param value The chunkOffsetsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setChunkOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - chunkOffsetsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * optional .vortex.dtype.PType chunk_offsets_ptype = 5; - * - * @return This builder for chaining. - */ - public Builder clearChunkOffsetsPtype() { - bitField0_ = (bitField0_ & ~0x00000010); - chunkOffsetsPtype_ = 0; - onChanged(); - return this; - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return Whether the offsetWithinChunk field is set. - */ - @java.lang.Override - public boolean hasOffsetWithinChunk() { - return ((bitField0_ & 0x00000020) != 0); - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return The offsetWithinChunk. - */ - @java.lang.Override - public long getOffsetWithinChunk() { - return offsetWithinChunk_; - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @param value The offsetWithinChunk to set. - * @return This builder for chaining. - */ - public Builder setOffsetWithinChunk(long value) { - - offsetWithinChunk_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - - /** - * optional uint64 offset_within_chunk = 6; - * - * @return This builder for chaining. - */ - public Builder clearOffsetWithinChunk() { - bitField0_ = (bitField0_ & ~0x00000020); - offsetWithinChunk_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.PatchesMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.SparseMetadata} - */ - public static final class SparseMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.SparseMetadata) - SparseMetadataOrBuilder { - public static final int PATCHES_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.SparseMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SparseMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "SparseMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata(); - } - - private int bitField0_; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private byte memoizedIsInitialized = -1; - - // Use SparseMetadata.newBuilder() to construct. - private SparseMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private SparseMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.Builder.class); - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return Whether the patches field is set. - */ - @java.lang.Override - public boolean hasPatches() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return The patches. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getPatches()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPatches()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata) obj; - - if (hasPatches() != other.hasPatches()) { - return false; - } - if (hasPatches()) { - if (!getPatches() - .equals(other.getPatches())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPatches()) { - hash = (37 * hash) + PATCHES_FIELD_NUMBER; - hash = (53 * hash) + getPatches().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.SparseMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.SparseMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadataOrBuilder { - private int bitField0_; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> patchesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetPatchesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SparseMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata result) { - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.patches_ = patchesBuilder_ == null - ? patches_ - : patchesBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.SparseMetadata.getDefaultInstance()) { - return this; - } - if (other.hasPatches()) { - mergePatches(other.getPatches()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetPatchesFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return Whether the patches field is set. - */ - public boolean hasPatches() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - * - * @return The patches. - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - if (patchesBuilder_ == null) { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } else { - return patchesBuilder_.getMessage(); - } - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public Builder setPatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - patches_ = value; - } else { - patchesBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public Builder setPatches( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder builderForValue) { - if (patchesBuilder_ == null) { - patches_ = builderForValue.build(); - } else { - patchesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public Builder mergePatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - patches_ != null && - patches_ != io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance()) { - getPatchesBuilder().mergeFrom(value); - } else { - patches_ = value; - } - } else { - patchesBuilder_.mergeFrom(value); - } - if (patches_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public Builder clearPatches() { - bitField0_ = (bitField0_ & ~0x00000001); - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder getPatchesBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return internalGetPatchesFieldBuilder().getBuilder(); - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - if (patchesBuilder_ != null) { - return patchesBuilder_.getMessageOrBuilder(); - } else { - return patches_ == null ? - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - } - - /** - * .vortex.encodings.PatchesMetadata patches = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> - internalGetPatchesFieldBuilder() { - if (patchesBuilder_ == null) { - patchesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder>( - getPatches(), - getParentForChildren(), - isClean()); - patches_ = null; - } - return patchesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.SparseMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.DictMetadata} - */ - public static final class DictMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.DictMetadata) - DictMetadataOrBuilder { - public static final int VALUES_LEN_FIELD_NUMBER = 1; - public static final int CODES_PTYPE_FIELD_NUMBER = 2; - public static final int IS_NULLABLE_CODES_FIELD_NUMBER = 3; - public static final int ALL_VALUES_REFERENCED_FIELD_NUMBER = 4; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.DictMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DictMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DictMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata(); - } - - private int bitField0_; - private int valuesLen_ = 0; - private int codesPtype_ = 0; - private boolean isNullableCodes_ = false; - private boolean allValuesReferenced_ = false; - private byte memoizedIsInitialized = -1; - - // Use DictMetadata.newBuilder() to construct. - private DictMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DictMetadata() { - codesPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.Builder.class); - } - - /** - * uint32 values_len = 1; - * - * @return The valuesLen. - */ - @java.lang.Override - public int getValuesLen() { - return valuesLen_; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The enum numeric value on the wire for codesPtype. - */ - @java.lang.Override - public int getCodesPtypeValue() { - return codesPtype_; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The codesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(codesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * optional bool is_nullable_codes = 3; - * - * @return Whether the isNullableCodes field is set. - */ - @java.lang.Override - public boolean hasIsNullableCodes() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * optional bool is_nullable_codes = 3; - * - * @return The isNullableCodes. - */ - @java.lang.Override - public boolean getIsNullableCodes() { - return isNullableCodes_; - } - - /** - * optional bool all_values_referenced = 4; - * - * @return Whether the allValuesReferenced field is set. - */ - @java.lang.Override - public boolean hasAllValuesReferenced() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * optional bool all_values_referenced = 4; - * - * @return The allValuesReferenced. - */ - @java.lang.Override - public boolean getAllValuesReferenced() { - return allValuesReferenced_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (valuesLen_ != 0) { - output.writeUInt32(1, valuesLen_); - } - if (codesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(2, codesPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeBool(3, isNullableCodes_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeBool(4, allValuesReferenced_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (valuesLen_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, valuesLen_); - } - if (codesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, codesPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, isNullableCodes_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(4, allValuesReferenced_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata) obj; - - if (getValuesLen() - != other.getValuesLen()) { - return false; - } - if (codesPtype_ != other.codesPtype_) { - return false; - } - if (hasIsNullableCodes() != other.hasIsNullableCodes()) { - return false; - } - if (hasIsNullableCodes()) { - if (getIsNullableCodes() - != other.getIsNullableCodes()) { - return false; - } - } - if (hasAllValuesReferenced() != other.hasAllValuesReferenced()) { - return false; - } - if (hasAllValuesReferenced()) { - if (getAllValuesReferenced() - != other.getAllValuesReferenced()) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUES_LEN_FIELD_NUMBER; - hash = (53 * hash) + getValuesLen(); - hash = (37 * hash) + CODES_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + codesPtype_; - if (hasIsNullableCodes()) { - hash = (37 * hash) + IS_NULLABLE_CODES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsNullableCodes()); - } - if (hasAllValuesReferenced()) { - hash = (37 * hash) + ALL_VALUES_REFERENCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getAllValuesReferenced()); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.DictMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.DictMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadataOrBuilder { - private int bitField0_; - private int valuesLen_; - private int codesPtype_ = 0; - private boolean isNullableCodes_; - private boolean allValuesReferenced_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - valuesLen_ = 0; - codesPtype_ = 0; - isNullableCodes_ = false; - allValuesReferenced_ = false; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DictMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.valuesLen_ = valuesLen_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.codesPtype_ = codesPtype_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000004) != 0)) { - result.isNullableCodes_ = isNullableCodes_; - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.allValuesReferenced_ = allValuesReferenced_; - to_bitField0_ |= 0x00000002; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.DictMetadata.getDefaultInstance()) { - return this; - } - if (other.getValuesLen() != 0) { - setValuesLen(other.getValuesLen()); - } - if (other.codesPtype_ != 0) { - setCodesPtypeValue(other.getCodesPtypeValue()); - } - if (other.hasIsNullableCodes()) { - setIsNullableCodes(other.getIsNullableCodes()); - } - if (other.hasAllValuesReferenced()) { - setAllValuesReferenced(other.getAllValuesReferenced()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - valuesLen_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - codesPtype_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - isNullableCodes_ = input.readBool(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 32: { - allValuesReferenced_ = input.readBool(); - bitField0_ |= 0x00000008; - break; - } // case 32 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 values_len = 1; - * - * @return The valuesLen. - */ - @java.lang.Override - public int getValuesLen() { - return valuesLen_; - } - - /** - * uint32 values_len = 1; - * - * @param value The valuesLen to set. - * @return This builder for chaining. - */ - public Builder setValuesLen(int value) { - - valuesLen_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 values_len = 1; - * - * @return This builder for chaining. - */ - public Builder clearValuesLen() { - bitField0_ = (bitField0_ & ~0x00000001); - valuesLen_ = 0; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The enum numeric value on the wire for codesPtype. - */ - @java.lang.Override - public int getCodesPtypeValue() { - return codesPtype_; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @param value The enum numeric value on the wire for codesPtype to set. - * @return This builder for chaining. - */ - public Builder setCodesPtypeValue(int value) { - codesPtype_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return The codesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(codesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @param value The codesPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setCodesPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - codesPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_ptype = 2; - * - * @return This builder for chaining. - */ - public Builder clearCodesPtype() { - bitField0_ = (bitField0_ & ~0x00000002); - codesPtype_ = 0; - onChanged(); - return this; - } - - /** - * optional bool is_nullable_codes = 3; - * - * @return Whether the isNullableCodes field is set. - */ - @java.lang.Override - public boolean hasIsNullableCodes() { - return ((bitField0_ & 0x00000004) != 0); - } - - /** - * optional bool is_nullable_codes = 3; - * - * @return The isNullableCodes. - */ - @java.lang.Override - public boolean getIsNullableCodes() { - return isNullableCodes_; - } - - /** - * optional bool is_nullable_codes = 3; - * - * @param value The isNullableCodes to set. - * @return This builder for chaining. - */ - public Builder setIsNullableCodes(boolean value) { - - isNullableCodes_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional bool is_nullable_codes = 3; - * - * @return This builder for chaining. - */ - public Builder clearIsNullableCodes() { - bitField0_ = (bitField0_ & ~0x00000004); - isNullableCodes_ = false; - onChanged(); - return this; - } - - /** - * optional bool all_values_referenced = 4; - * - * @return Whether the allValuesReferenced field is set. - */ - @java.lang.Override - public boolean hasAllValuesReferenced() { - return ((bitField0_ & 0x00000008) != 0); - } - - /** - * optional bool all_values_referenced = 4; - * - * @return The allValuesReferenced. - */ - @java.lang.Override - public boolean getAllValuesReferenced() { - return allValuesReferenced_; - } - - /** - * optional bool all_values_referenced = 4; - * - * @param value The allValuesReferenced to set. - * @return This builder for chaining. - */ - public Builder setAllValuesReferenced(boolean value) { - - allValuesReferenced_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - /** - * optional bool all_values_referenced = 4; - * - * @return This builder for chaining. - */ - public Builder clearAllValuesReferenced() { - bitField0_ = (bitField0_ & ~0x00000008); - allValuesReferenced_ = false; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.DictMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.RunEndMetadata} - */ - public static final class RunEndMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.RunEndMetadata) - RunEndMetadataOrBuilder { - public static final int ENDS_PTYPE_FIELD_NUMBER = 1; - public static final int NUM_RUNS_FIELD_NUMBER = 2; - public static final int OFFSET_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.RunEndMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RunEndMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "RunEndMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata(); - } - - private int endsPtype_ = 0; - private long numRuns_ = 0L; - private long offset_ = 0L; - private byte memoizedIsInitialized = -1; - - // Use RunEndMetadata.newBuilder() to construct. - private RunEndMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private RunEndMetadata() { - endsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.Builder.class); - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The enum numeric value on the wire for endsPtype. - */ - @java.lang.Override - public int getEndsPtypeValue() { - return endsPtype_; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The endsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getEndsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(endsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * uint64 num_runs = 2; - * - * @return The numRuns. - */ - @java.lang.Override - public long getNumRuns() { - return numRuns_; - } - - /** - * uint64 offset = 3; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (endsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, endsPtype_); - } - if (numRuns_ != 0L) { - output.writeUInt64(2, numRuns_); - } - if (offset_ != 0L) { - output.writeUInt64(3, offset_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (endsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, endsPtype_); - } - if (numRuns_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, numRuns_); - } - if (offset_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, offset_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata) obj; - - if (endsPtype_ != other.endsPtype_) { - return false; - } - if (getNumRuns() - != other.getNumRuns()) { - return false; - } - if (getOffset() - != other.getOffset()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENDS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + endsPtype_; - hash = (37 * hash) + NUM_RUNS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNumRuns()); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffset()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.RunEndMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.RunEndMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadataOrBuilder { - private int bitField0_; - private int endsPtype_ = 0; - private long numRuns_; - private long offset_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - endsPtype_ = 0; - numRuns_ = 0L; - offset_ = 0L; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RunEndMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.endsPtype_ = endsPtype_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.numRuns_ = numRuns_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.offset_ = offset_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.RunEndMetadata.getDefaultInstance()) { - return this; - } - if (other.endsPtype_ != 0) { - setEndsPtypeValue(other.getEndsPtypeValue()); - } - if (other.getNumRuns() != 0L) { - setNumRuns(other.getNumRuns()); - } - if (other.getOffset() != 0L) { - setOffset(other.getOffset()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - endsPtype_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - numRuns_ = input.readUInt64(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - offset_ = input.readUInt64(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The enum numeric value on the wire for endsPtype. - */ - @java.lang.Override - public int getEndsPtypeValue() { - return endsPtype_; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @param value The enum numeric value on the wire for endsPtype to set. - * @return This builder for chaining. - */ - public Builder setEndsPtypeValue(int value) { - endsPtype_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return The endsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getEndsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(endsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @param value The endsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setEndsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - endsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType ends_ptype = 1; - * - * @return This builder for chaining. - */ - public Builder clearEndsPtype() { - bitField0_ = (bitField0_ & ~0x00000001); - endsPtype_ = 0; - onChanged(); - return this; - } - - /** - * uint64 num_runs = 2; - * - * @return The numRuns. - */ - @java.lang.Override - public long getNumRuns() { - return numRuns_; - } - - /** - * uint64 num_runs = 2; - * - * @param value The numRuns to set. - * @return This builder for chaining. - */ - public Builder setNumRuns(long value) { - - numRuns_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint64 num_runs = 2; - * - * @return This builder for chaining. - */ - public Builder clearNumRuns() { - bitField0_ = (bitField0_ & ~0x00000002); - numRuns_ = 0L; - onChanged(); - return this; - } - - /** - * uint64 offset = 3; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - /** - * uint64 offset = 3; - * - * @param value The offset to set. - * @return This builder for chaining. - */ - public Builder setOffset(long value) { - - offset_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * uint64 offset = 3; - * - * @return This builder for chaining. - */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000004); - offset_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.RunEndMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ALPMetadata} - */ - public static final class ALPMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ALPMetadata) - ALPMetadataOrBuilder { - public static final int EXP_E_FIELD_NUMBER = 1; - public static final int EXP_F_FIELD_NUMBER = 2; - public static final int PATCHES_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ALPMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ALPMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ALPMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata(); - } - - private int bitField0_; - private int expE_ = 0; - private int expF_ = 0; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private byte memoizedIsInitialized = -1; - - // Use ALPMetadata.newBuilder() to construct. - private ALPMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ALPMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.Builder.class); - } - - /** - * uint32 exp_e = 1; - * - * @return The expE. - */ - @java.lang.Override - public int getExpE() { - return expE_; - } - - /** - * uint32 exp_f = 2; - * - * @return The expF. - */ - @java.lang.Override - public int getExpF() { - return expF_; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - @java.lang.Override - public boolean hasPatches() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (expE_ != 0) { - output.writeUInt32(1, expE_); - } - if (expF_ != 0) { - output.writeUInt32(2, expF_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(3, getPatches()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (expE_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, expE_); - } - if (expF_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, expF_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPatches()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata) obj; - - if (getExpE() - != other.getExpE()) { - return false; - } - if (getExpF() - != other.getExpF()) { - return false; - } - if (hasPatches() != other.hasPatches()) { - return false; - } - if (hasPatches()) { - if (!getPatches() - .equals(other.getPatches())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + EXP_E_FIELD_NUMBER; - hash = (53 * hash) + getExpE(); - hash = (37 * hash) + EXP_F_FIELD_NUMBER; - hash = (53 * hash) + getExpF(); - if (hasPatches()) { - hash = (37 * hash) + PATCHES_FIELD_NUMBER; - hash = (53 * hash) + getPatches().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ALPMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ALPMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadataOrBuilder { - private int bitField0_; - private int expE_; - private int expF_; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> patchesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetPatchesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - expE_ = 0; - expF_ = 0; - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.expE_ = expE_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.expF_ = expF_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000004) != 0)) { - result.patches_ = patchesBuilder_ == null - ? patches_ - : patchesBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ALPMetadata.getDefaultInstance()) { - return this; - } - if (other.getExpE() != 0) { - setExpE(other.getExpE()); - } - if (other.getExpF() != 0) { - setExpF(other.getExpF()); - } - if (other.hasPatches()) { - mergePatches(other.getPatches()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - expE_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - expF_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: { - input.readMessage( - internalGetPatchesFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 exp_e = 1; - * - * @return The expE. - */ - @java.lang.Override - public int getExpE() { - return expE_; - } - - /** - * uint32 exp_e = 1; - * - * @param value The expE to set. - * @return This builder for chaining. - */ - public Builder setExpE(int value) { - - expE_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 exp_e = 1; - * - * @return This builder for chaining. - */ - public Builder clearExpE() { - bitField0_ = (bitField0_ & ~0x00000001); - expE_ = 0; - onChanged(); - return this; - } - - /** - * uint32 exp_f = 2; - * - * @return The expF. - */ - @java.lang.Override - public int getExpF() { - return expF_; - } - - /** - * uint32 exp_f = 2; - * - * @param value The expF to set. - * @return This builder for chaining. - */ - public Builder setExpF(int value) { - - expF_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 exp_f = 2; - * - * @return This builder for chaining. - */ - public Builder clearExpF() { - bitField0_ = (bitField0_ & ~0x00000002); - expF_ = 0; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - public boolean hasPatches() { - return ((bitField0_ & 0x00000004) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - if (patchesBuilder_ == null) { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } else { - return patchesBuilder_.getMessage(); - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder setPatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - patches_ = value; - } else { - patchesBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder setPatches( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder builderForValue) { - if (patchesBuilder_ == null) { - patches_ = builderForValue.build(); - } else { - patchesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder mergePatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) && - patches_ != null && - patches_ != io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance()) { - getPatchesBuilder().mergeFrom(value); - } else { - patches_ = value; - } - } else { - patchesBuilder_.mergeFrom(value); - } - if (patches_ != null) { - bitField0_ |= 0x00000004; - onChanged(); - } - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder clearPatches() { - bitField0_ = (bitField0_ & ~0x00000004); - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder getPatchesBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return internalGetPatchesFieldBuilder().getBuilder(); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - if (patchesBuilder_ != null) { - return patchesBuilder_.getMessageOrBuilder(); - } else { - return patches_ == null ? - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> - internalGetPatchesFieldBuilder() { - if (patchesBuilder_ == null) { - patchesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder>( - getPatches(), - getParentForChildren(), - isClean()); - patches_ = null; - } - return patchesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ALPMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.BitPackedMetadata} - */ - public static final class BitPackedMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.BitPackedMetadata) - BitPackedMetadataOrBuilder { - public static final int BIT_WIDTH_FIELD_NUMBER = 1; - public static final int OFFSET_FIELD_NUMBER = 2; - public static final int PATCHES_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.BitPackedMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public BitPackedMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "BitPackedMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata(); - } - - private int bitField0_; - private int bitWidth_ = 0; - private int offset_ = 0; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private byte memoizedIsInitialized = -1; - - // Use BitPackedMetadata.newBuilder() to construct. - private BitPackedMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private BitPackedMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.Builder.class); - } - - /** - * uint32 bit_width = 1; - * - * @return The bitWidth. - */ - @java.lang.Override - public int getBitWidth() { - return bitWidth_; - } - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public int getOffset() { - return offset_; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - @java.lang.Override - public boolean hasPatches() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (bitWidth_ != 0) { - output.writeUInt32(1, bitWidth_); - } - if (offset_ != 0) { - output.writeUInt32(2, offset_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(3, getPatches()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (bitWidth_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, bitWidth_); - } - if (offset_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, offset_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPatches()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata) obj; - - if (getBitWidth() - != other.getBitWidth()) { - return false; - } - if (getOffset() - != other.getOffset()) { - return false; - } - if (hasPatches() != other.hasPatches()) { - return false; - } - if (hasPatches()) { - if (!getPatches() - .equals(other.getPatches())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + BIT_WIDTH_FIELD_NUMBER; - hash = (53 * hash) + getBitWidth(); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getOffset(); - if (hasPatches()) { - hash = (37 * hash) + PATCHES_FIELD_NUMBER; - hash = (53 * hash) + getPatches().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.BitPackedMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.BitPackedMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadataOrBuilder { - private int bitField0_; - private int bitWidth_; - private int offset_; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> patchesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetPatchesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - bitWidth_ = 0; - offset_ = 0; - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_BitPackedMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.bitWidth_ = bitWidth_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.offset_ = offset_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000004) != 0)) { - result.patches_ = patchesBuilder_ == null - ? patches_ - : patchesBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.BitPackedMetadata.getDefaultInstance()) { - return this; - } - if (other.getBitWidth() != 0) { - setBitWidth(other.getBitWidth()); - } - if (other.getOffset() != 0) { - setOffset(other.getOffset()); - } - if (other.hasPatches()) { - mergePatches(other.getPatches()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - bitWidth_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - offset_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: { - input.readMessage( - internalGetPatchesFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000004; - break; - } // case 26 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 bit_width = 1; - * - * @return The bitWidth. - */ - @java.lang.Override - public int getBitWidth() { - return bitWidth_; - } - - /** - * uint32 bit_width = 1; - * - * @param value The bitWidth to set. - * @return This builder for chaining. - */ - public Builder setBitWidth(int value) { - - bitWidth_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 bit_width = 1; - * - * @return This builder for chaining. - */ - public Builder clearBitWidth() { - bitField0_ = (bitField0_ & ~0x00000001); - bitWidth_ = 0; - onChanged(); - return this; - } - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public int getOffset() { - return offset_; - } - - /** - * uint32 offset = 2; - * - * @param value The offset to set. - * @return This builder for chaining. - */ - public Builder setOffset(int value) { - - offset_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 offset = 2; - * - * @return This builder for chaining. - */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000002); - offset_ = 0; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return Whether the patches field is set. - */ - public boolean hasPatches() { - return ((bitField0_ & 0x00000004) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - * - * @return The patches. - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - if (patchesBuilder_ == null) { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } else { - return patchesBuilder_.getMessage(); - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder setPatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - patches_ = value; - } else { - patchesBuilder_.setMessage(value); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder setPatches( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder builderForValue) { - if (patchesBuilder_ == null) { - patches_ = builderForValue.build(); - } else { - patchesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder mergePatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0) && - patches_ != null && - patches_ != io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance()) { - getPatchesBuilder().mergeFrom(value); - } else { - patches_ = value; - } - } else { - patchesBuilder_.mergeFrom(value); - } - if (patches_ != null) { - bitField0_ |= 0x00000004; - onChanged(); - } - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public Builder clearPatches() { - bitField0_ = (bitField0_ & ~0x00000004); - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder getPatchesBuilder() { - bitField0_ |= 0x00000004; - onChanged(); - return internalGetPatchesFieldBuilder().getBuilder(); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - if (patchesBuilder_ != null) { - return patchesBuilder_.getMessageOrBuilder(); - } else { - return patches_ == null ? - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 3; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> - internalGetPatchesFieldBuilder() { - if (patchesBuilder_ == null) { - patchesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder>( - getPatches(), - getParentForChildren(), - isClean()); - patches_ = null; - } - return patchesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.BitPackedMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.SequenceMetadata} - */ - public static final class SequenceMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.SequenceMetadata) - SequenceMetadataOrBuilder { - public static final int BASE_FIELD_NUMBER = 1; - public static final int MULTIPLIER_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.SequenceMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SequenceMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "SequenceMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata(); - } - - private int bitField0_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue base_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue multiplier_; - private byte memoizedIsInitialized = -1; - - // Use SequenceMetadata.newBuilder() to construct. - private SequenceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private SequenceMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.Builder.class); - } - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return Whether the base field is set. - */ - @java.lang.Override - public boolean hasBase() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return The base. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getBase() { - return base_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : base_; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getBaseOrBuilder() { - return base_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : base_; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return Whether the multiplier field is set. - */ - @java.lang.Override - public boolean hasMultiplier() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return The multiplier. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getMultiplier() { - return multiplier_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : multiplier_; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getMultiplierOrBuilder() { - return multiplier_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : multiplier_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getBase()); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeMessage(2, getMultiplier()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getBase()); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getMultiplier()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata) obj; - - if (hasBase() != other.hasBase()) { - return false; - } - if (hasBase()) { - if (!getBase() - .equals(other.getBase())) { - return false; - } - } - if (hasMultiplier() != other.hasMultiplier()) { - return false; - } - if (hasMultiplier()) { - if (!getMultiplier() - .equals(other.getMultiplier())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasBase()) { - hash = (37 * hash) + BASE_FIELD_NUMBER; - hash = (53 * hash) + getBase().hashCode(); - } - if (hasMultiplier()) { - hash = (37 * hash) + MULTIPLIER_FIELD_NUMBER; - hash = (53 * hash) + getMultiplier().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.SequenceMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.SequenceMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadataOrBuilder { - private int bitField0_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue base_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> baseBuilder_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue multiplier_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> multiplierBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetBaseFieldBuilder(); - internalGetMultiplierFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - base_ = null; - if (baseBuilder_ != null) { - baseBuilder_.dispose(); - baseBuilder_ = null; - } - multiplier_ = null; - if (multiplierBuilder_ != null) { - multiplierBuilder_.dispose(); - multiplierBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_SequenceMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata result) { - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.base_ = baseBuilder_ == null - ? base_ - : baseBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.multiplier_ = multiplierBuilder_ == null - ? multiplier_ - : multiplierBuilder_.build(); - to_bitField0_ |= 0x00000002; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.SequenceMetadata.getDefaultInstance()) { - return this; - } - if (other.hasBase()) { - mergeBase(other.getBase()); - } - if (other.hasMultiplier()) { - mergeMultiplier(other.getMultiplier()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetBaseFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: { - input.readMessage( - internalGetMultiplierFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return Whether the base field is set. - */ - public boolean hasBase() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.scalar.ScalarValue base = 1; - * - * @return The base. - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getBase() { - if (baseBuilder_ == null) { - return base_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : base_; - } else { - return baseBuilder_.getMessage(); - } - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public Builder setBase(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (baseBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - base_ = value; - } else { - baseBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public Builder setBase( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (baseBuilder_ == null) { - base_ = builderForValue.build(); - } else { - baseBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public Builder mergeBase(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (baseBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - base_ != null && - base_ != io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()) { - getBaseBuilder().mergeFrom(value); - } else { - base_ = value; - } - } else { - baseBuilder_.mergeFrom(value); - } - if (base_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public Builder clearBase() { - bitField0_ = (bitField0_ & ~0x00000001); - base_ = null; - if (baseBuilder_ != null) { - baseBuilder_.dispose(); - baseBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder getBaseBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return internalGetBaseFieldBuilder().getBuilder(); - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getBaseOrBuilder() { - if (baseBuilder_ != null) { - return baseBuilder_.getMessageOrBuilder(); - } else { - return base_ == null ? - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : base_; - } - } - - /** - * .vortex.scalar.ScalarValue base = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> - internalGetBaseFieldBuilder() { - if (baseBuilder_ == null) { - baseBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder>( - getBase(), - getParentForChildren(), - isClean()); - base_ = null; - } - return baseBuilder_; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return Whether the multiplier field is set. - */ - public boolean hasMultiplier() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - * - * @return The multiplier. - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getMultiplier() { - if (multiplierBuilder_ == null) { - return multiplier_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : multiplier_; - } else { - return multiplierBuilder_.getMessage(); - } - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public Builder setMultiplier(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (multiplierBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - multiplier_ = value; - } else { - multiplierBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public Builder setMultiplier( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (multiplierBuilder_ == null) { - multiplier_ = builderForValue.build(); - } else { - multiplierBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public Builder mergeMultiplier(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (multiplierBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) && - multiplier_ != null && - multiplier_ != io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()) { - getMultiplierBuilder().mergeFrom(value); - } else { - multiplier_ = value; - } - } else { - multiplierBuilder_.mergeFrom(value); - } - if (multiplier_ != null) { - bitField0_ |= 0x00000002; - onChanged(); - } - return this; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public Builder clearMultiplier() { - bitField0_ = (bitField0_ & ~0x00000002); - multiplier_ = null; - if (multiplierBuilder_ != null) { - multiplierBuilder_.dispose(); - multiplierBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder getMultiplierBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return internalGetMultiplierFieldBuilder().getBuilder(); - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getMultiplierOrBuilder() { - if (multiplierBuilder_ != null) { - return multiplierBuilder_.getMessageOrBuilder(); - } else { - return multiplier_ == null ? - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : multiplier_; - } - } - - /** - * .vortex.scalar.ScalarValue multiplier = 2; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> - internalGetMultiplierFieldBuilder() { - if (multiplierBuilder_ == null) { - multiplierBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder>( - getMultiplier(), - getParentForChildren(), - isClean()); - multiplier_ = null; - } - return multiplierBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.SequenceMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.VarBinMetadata} - */ - public static final class VarBinMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.VarBinMetadata) - VarBinMetadataOrBuilder { - public static final int OFFSETS_PTYPE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.VarBinMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public VarBinMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "VarBinMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata(); - } - - private int offsetsPtype_ = 0; - private byte memoizedIsInitialized = -1; - - // Use VarBinMetadata.newBuilder() to construct. - private VarBinMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private VarBinMetadata() { - offsetsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.Builder.class); - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The enum numeric value on the wire for offsetsPtype. - */ - @java.lang.Override - public int getOffsetsPtypeValue() { - return offsetsPtype_; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The offsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (offsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, offsetsPtype_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (offsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, offsetsPtype_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata) obj; - - if (offsetsPtype_ != other.offsetsPtype_) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + OFFSETS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + offsetsPtype_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.VarBinMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.VarBinMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadataOrBuilder { - private int bitField0_; - private int offsetsPtype_ = 0; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - offsetsPtype_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_VarBinMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.offsetsPtype_ = offsetsPtype_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.VarBinMetadata.getDefaultInstance()) { - return this; - } - if (other.offsetsPtype_ != 0) { - setOffsetsPtypeValue(other.getOffsetsPtypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - offsetsPtype_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The enum numeric value on the wire for offsetsPtype. - */ - @java.lang.Override - public int getOffsetsPtypeValue() { - return offsetsPtype_; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @param value The enum numeric value on the wire for offsetsPtype to set. - * @return This builder for chaining. - */ - public Builder setOffsetsPtypeValue(int value) { - offsetsPtype_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return The offsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @param value The offsetsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - offsetsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offsets_ptype = 1; - * - * @return This builder for chaining. - */ - public Builder clearOffsetsPtype() { - bitField0_ = (bitField0_ & ~0x00000001); - offsetsPtype_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.VarBinMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.FSSTMetadata} - */ - public static final class FSSTMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.FSSTMetadata) - FSSTMetadataOrBuilder { - public static final int UNCOMPRESSED_LENGTHS_PTYPE_FIELD_NUMBER = 1; - public static final int CODES_OFFSETS_PTYPE_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.FSSTMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public FSSTMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "FSSTMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata(); - } - - private int uncompressedLengthsPtype_ = 0; - private int codesOffsetsPtype_ = 0; - private byte memoizedIsInitialized = -1; - - // Use FSSTMetadata.newBuilder() to construct. - private FSSTMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private FSSTMetadata() { - uncompressedLengthsPtype_ = 0; - codesOffsetsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.Builder.class); - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The enum numeric value on the wire for uncompressedLengthsPtype. - */ - @java.lang.Override - public int getUncompressedLengthsPtypeValue() { - return uncompressedLengthsPtype_; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The uncompressedLengthsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getUncompressedLengthsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(uncompressedLengthsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The enum numeric value on the wire for codesOffsetsPtype. - */ - @java.lang.Override - public int getCodesOffsetsPtypeValue() { - return codesOffsetsPtype_; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The codesOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(codesOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (uncompressedLengthsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, uncompressedLengthsPtype_); - } - if (codesOffsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(2, codesOffsetsPtype_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (uncompressedLengthsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, uncompressedLengthsPtype_); - } - if (codesOffsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, codesOffsetsPtype_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata) obj; - - if (uncompressedLengthsPtype_ != other.uncompressedLengthsPtype_) { - return false; - } - if (codesOffsetsPtype_ != other.codesOffsetsPtype_) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UNCOMPRESSED_LENGTHS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + uncompressedLengthsPtype_; - hash = (37 * hash) + CODES_OFFSETS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + codesOffsetsPtype_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.FSSTMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.FSSTMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadataOrBuilder { - private int bitField0_; - private int uncompressedLengthsPtype_ = 0; - private int codesOffsetsPtype_ = 0; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - uncompressedLengthsPtype_ = 0; - codesOffsetsPtype_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_FSSTMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.uncompressedLengthsPtype_ = uncompressedLengthsPtype_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.codesOffsetsPtype_ = codesOffsetsPtype_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.FSSTMetadata.getDefaultInstance()) { - return this; - } - if (other.uncompressedLengthsPtype_ != 0) { - setUncompressedLengthsPtypeValue(other.getUncompressedLengthsPtypeValue()); - } - if (other.codesOffsetsPtype_ != 0) { - setCodesOffsetsPtypeValue(other.getCodesOffsetsPtypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - uncompressedLengthsPtype_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - codesOffsetsPtype_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The enum numeric value on the wire for uncompressedLengthsPtype. - */ - @java.lang.Override - public int getUncompressedLengthsPtypeValue() { - return uncompressedLengthsPtype_; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @param value The enum numeric value on the wire for uncompressedLengthsPtype to set. - * @return This builder for chaining. - */ - public Builder setUncompressedLengthsPtypeValue(int value) { - uncompressedLengthsPtype_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return The uncompressedLengthsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getUncompressedLengthsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(uncompressedLengthsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @param value The uncompressedLengthsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setUncompressedLengthsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - uncompressedLengthsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType uncompressed_lengths_ptype = 1; - * - * @return This builder for chaining. - */ - public Builder clearUncompressedLengthsPtype() { - bitField0_ = (bitField0_ & ~0x00000001); - uncompressedLengthsPtype_ = 0; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The enum numeric value on the wire for codesOffsetsPtype. - */ - @java.lang.Override - public int getCodesOffsetsPtypeValue() { - return codesOffsetsPtype_; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @param value The enum numeric value on the wire for codesOffsetsPtype to set. - * @return This builder for chaining. - */ - public Builder setCodesOffsetsPtypeValue(int value) { - codesOffsetsPtype_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return The codesOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getCodesOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(codesOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @param value The codesOffsetsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setCodesOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - codesOffsetsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType codes_offsets_ptype = 2; - * - * @return This builder for chaining. - */ - public Builder clearCodesOffsetsPtype() { - bitField0_ = (bitField0_ & ~0x00000002); - codesOffsetsPtype_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.FSSTMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.DeltaMetadata} - */ - public static final class DeltaMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.DeltaMetadata) - DeltaMetadataOrBuilder { - public static final int DELTAS_LEN_FIELD_NUMBER = 1; - public static final int OFFSET_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.DeltaMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeltaMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DeltaMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata(); - } - - private long deltasLen_ = 0L; - private int offset_ = 0; - private byte memoizedIsInitialized = -1; - - // Use DeltaMetadata.newBuilder() to construct. - private DeltaMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DeltaMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.Builder.class); - } - - /** - * uint64 deltas_len = 1; - * - * @return The deltasLen. - */ - @java.lang.Override - public long getDeltasLen() { - return deltasLen_; - } - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public int getOffset() { - return offset_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (deltasLen_ != 0L) { - output.writeUInt64(1, deltasLen_); - } - if (offset_ != 0) { - output.writeUInt32(2, offset_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (deltasLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, deltasLen_); - } - if (offset_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, offset_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata) obj; - - if (getDeltasLen() - != other.getDeltasLen()) { - return false; - } - if (getOffset() - != other.getOffset()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DELTAS_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getDeltasLen()); - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + getOffset(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.DeltaMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.DeltaMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadataOrBuilder { - private int bitField0_; - private long deltasLen_; - private int offset_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - deltasLen_ = 0L; - offset_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DeltaMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.deltasLen_ = deltasLen_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.offset_ = offset_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.DeltaMetadata.getDefaultInstance()) { - return this; - } - if (other.getDeltasLen() != 0L) { - setDeltasLen(other.getDeltasLen()); - } - if (other.getOffset() != 0) { - setOffset(other.getOffset()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - deltasLen_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - offset_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 deltas_len = 1; - * - * @return The deltasLen. - */ - @java.lang.Override - public long getDeltasLen() { - return deltasLen_; - } - - /** - * uint64 deltas_len = 1; - * - * @param value The deltasLen to set. - * @return This builder for chaining. - */ - public Builder setDeltasLen(long value) { - - deltasLen_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 deltas_len = 1; - * - * @return This builder for chaining. - */ - public Builder clearDeltasLen() { - bitField0_ = (bitField0_ & ~0x00000001); - deltasLen_ = 0L; - onChanged(); - return this; - } - - /** - * uint32 offset = 2; - * - * @return The offset. - */ - @java.lang.Override - public int getOffset() { - return offset_; - } - - /** - * uint32 offset = 2; - * - * @param value The offset to set. - * @return This builder for chaining. - */ - public Builder setOffset(int value) { - - offset_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 offset = 2; - * - * @return This builder for chaining. - */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000002); - offset_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.DeltaMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.DecimalMetadata} - */ - public static final class DecimalMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.DecimalMetadata) - DecimalMetadataOrBuilder { - public static final int VALUES_TYPE_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.DecimalMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DecimalMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DecimalMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata(); - } - - private int valuesType_ = 0; - private byte memoizedIsInitialized = -1; - - // Use DecimalMetadata.newBuilder() to construct. - private DecimalMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DecimalMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.Builder.class); - } - - /** - *
    -         * DecimalType: I8=0, I16=1, I32=2, I64=3, I128=4, I256=5
    -         * 
    - * - * int32 values_type = 1; - * - * @return The valuesType. - */ - @java.lang.Override - public int getValuesType() { - return valuesType_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (valuesType_ != 0) { - output.writeInt32(1, valuesType_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (valuesType_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, valuesType_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata) obj; - - if (getValuesType() - != other.getValuesType()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUES_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getValuesType(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.DecimalMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.DecimalMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadataOrBuilder { - private int bitField0_; - private int valuesType_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - valuesType_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.valuesType_ = valuesType_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.DecimalMetadata.getDefaultInstance()) { - return this; - } - if (other.getValuesType() != 0) { - setValuesType(other.getValuesType()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - valuesType_ = input.readInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - *
    -             * DecimalType: I8=0, I16=1, I32=2, I64=3, I128=4, I256=5
    -             * 
    - * - * int32 values_type = 1; - * - * @return The valuesType. - */ - @java.lang.Override - public int getValuesType() { - return valuesType_; - } - - /** - *
    -             * DecimalType: I8=0, I16=1, I32=2, I64=3, I128=4, I256=5
    -             * 
    - * - * int32 values_type = 1; - * - * @param value The valuesType to set. - * @return This builder for chaining. - */ - public Builder setValuesType(int value) { - - valuesType_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - *
    -             * DecimalType: I8=0, I16=1, I32=2, I64=3, I128=4, I256=5
    -             * 
    - * - * int32 values_type = 1; - * - * @return This builder for chaining. - */ - public Builder clearValuesType() { - bitField0_ = (bitField0_ & ~0x00000001); - valuesType_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.DecimalMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.DecimalBytePartsMetadata} - */ - public static final class DecimalBytePartsMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.DecimalBytePartsMetadata) - DecimalBytePartsMetadataOrBuilder { - public static final int ZEROTH_CHILD_PTYPE_FIELD_NUMBER = 1; - public static final int LOWER_PART_COUNT_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.DecimalBytePartsMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DecimalBytePartsMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DecimalBytePartsMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata(); - } - - private int zerothChildPtype_ = 0; - private int lowerPartCount_ = 0; - private byte memoizedIsInitialized = -1; - - // Use DecimalBytePartsMetadata.newBuilder() to construct. - private DecimalBytePartsMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DecimalBytePartsMetadata() { - zerothChildPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.Builder.class); - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The enum numeric value on the wire for zerothChildPtype. - */ - @java.lang.Override - public int getZerothChildPtypeValue() { - return zerothChildPtype_; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The zerothChildPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getZerothChildPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(zerothChildPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * uint32 lower_part_count = 2; - * - * @return The lowerPartCount. - */ - @java.lang.Override - public int getLowerPartCount() { - return lowerPartCount_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (zerothChildPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, zerothChildPtype_); - } - if (lowerPartCount_ != 0) { - output.writeUInt32(2, lowerPartCount_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (zerothChildPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, zerothChildPtype_); - } - if (lowerPartCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, lowerPartCount_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata) obj; - - if (zerothChildPtype_ != other.zerothChildPtype_) { - return false; - } - if (getLowerPartCount() - != other.getLowerPartCount()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ZEROTH_CHILD_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + zerothChildPtype_; - hash = (37 * hash) + LOWER_PART_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getLowerPartCount(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.DecimalBytePartsMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.DecimalBytePartsMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadataOrBuilder { - private int bitField0_; - private int zerothChildPtype_ = 0; - private int lowerPartCount_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - zerothChildPtype_ = 0; - lowerPartCount_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DecimalBytePartsMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.zerothChildPtype_ = zerothChildPtype_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.lowerPartCount_ = lowerPartCount_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.DecimalBytePartsMetadata.getDefaultInstance()) { - return this; - } - if (other.zerothChildPtype_ != 0) { - setZerothChildPtypeValue(other.getZerothChildPtypeValue()); - } - if (other.getLowerPartCount() != 0) { - setLowerPartCount(other.getLowerPartCount()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - zerothChildPtype_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - lowerPartCount_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The enum numeric value on the wire for zerothChildPtype. - */ - @java.lang.Override - public int getZerothChildPtypeValue() { - return zerothChildPtype_; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @param value The enum numeric value on the wire for zerothChildPtype to set. - * @return This builder for chaining. - */ - public Builder setZerothChildPtypeValue(int value) { - zerothChildPtype_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return The zerothChildPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getZerothChildPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(zerothChildPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @param value The zerothChildPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setZerothChildPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - zerothChildPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType zeroth_child_ptype = 1; - * - * @return This builder for chaining. - */ - public Builder clearZerothChildPtype() { - bitField0_ = (bitField0_ & ~0x00000001); - zerothChildPtype_ = 0; - onChanged(); - return this; - } - - /** - * uint32 lower_part_count = 2; - * - * @return The lowerPartCount. - */ - @java.lang.Override - public int getLowerPartCount() { - return lowerPartCount_; - } - - /** - * uint32 lower_part_count = 2; - * - * @param value The lowerPartCount to set. - * @return This builder for chaining. - */ - public Builder setLowerPartCount(int value) { - - lowerPartCount_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 lower_part_count = 2; - * - * @return This builder for chaining. - */ - public Builder clearLowerPartCount() { - bitField0_ = (bitField0_ & ~0x00000002); - lowerPartCount_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.DecimalBytePartsMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.DateTimePartsMetadata} - */ - public static final class DateTimePartsMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.DateTimePartsMetadata) - DateTimePartsMetadataOrBuilder { - public static final int DAYS_PTYPE_FIELD_NUMBER = 1; - public static final int SECONDS_PTYPE_FIELD_NUMBER = 2; - public static final int SUBSECONDS_PTYPE_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.DateTimePartsMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DateTimePartsMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "DateTimePartsMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata(); - } - - private int daysPtype_ = 0; - private int secondsPtype_ = 0; - private int subsecondsPtype_ = 0; - private byte memoizedIsInitialized = -1; - - // Use DateTimePartsMetadata.newBuilder() to construct. - private DateTimePartsMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private DateTimePartsMetadata() { - daysPtype_ = 0; - secondsPtype_ = 0; - subsecondsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.Builder.class); - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The enum numeric value on the wire for daysPtype. - */ - @java.lang.Override - public int getDaysPtypeValue() { - return daysPtype_; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The daysPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getDaysPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(daysPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The enum numeric value on the wire for secondsPtype. - */ - @java.lang.Override - public int getSecondsPtypeValue() { - return secondsPtype_; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The secondsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSecondsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(secondsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The enum numeric value on the wire for subsecondsPtype. - */ - @java.lang.Override - public int getSubsecondsPtypeValue() { - return subsecondsPtype_; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The subsecondsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSubsecondsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(subsecondsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (daysPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(1, daysPtype_); - } - if (secondsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(2, secondsPtype_); - } - if (subsecondsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(3, subsecondsPtype_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (daysPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, daysPtype_); - } - if (secondsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, secondsPtype_); - } - if (subsecondsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, subsecondsPtype_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata) obj; - - if (daysPtype_ != other.daysPtype_) { - return false; - } - if (secondsPtype_ != other.secondsPtype_) { - return false; - } - if (subsecondsPtype_ != other.subsecondsPtype_) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DAYS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + daysPtype_; - hash = (37 * hash) + SECONDS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + secondsPtype_; - hash = (37 * hash) + SUBSECONDS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + subsecondsPtype_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.DateTimePartsMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.DateTimePartsMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadataOrBuilder { - private int bitField0_; - private int daysPtype_ = 0; - private int secondsPtype_ = 0; - private int subsecondsPtype_ = 0; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - daysPtype_ = 0; - secondsPtype_ = 0; - subsecondsPtype_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_DateTimePartsMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.daysPtype_ = daysPtype_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.secondsPtype_ = secondsPtype_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.subsecondsPtype_ = subsecondsPtype_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.DateTimePartsMetadata.getDefaultInstance()) { - return this; - } - if (other.daysPtype_ != 0) { - setDaysPtypeValue(other.getDaysPtypeValue()); - } - if (other.secondsPtype_ != 0) { - setSecondsPtypeValue(other.getSecondsPtypeValue()); - } - if (other.subsecondsPtype_ != 0) { - setSubsecondsPtypeValue(other.getSubsecondsPtypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - daysPtype_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - secondsPtype_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - subsecondsPtype_ = input.readEnum(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The enum numeric value on the wire for daysPtype. - */ - @java.lang.Override - public int getDaysPtypeValue() { - return daysPtype_; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @param value The enum numeric value on the wire for daysPtype to set. - * @return This builder for chaining. - */ - public Builder setDaysPtypeValue(int value) { - daysPtype_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return The daysPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getDaysPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(daysPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @param value The daysPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setDaysPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - daysPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType days_ptype = 1; - * - * @return This builder for chaining. - */ - public Builder clearDaysPtype() { - bitField0_ = (bitField0_ & ~0x00000001); - daysPtype_ = 0; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The enum numeric value on the wire for secondsPtype. - */ - @java.lang.Override - public int getSecondsPtypeValue() { - return secondsPtype_; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @param value The enum numeric value on the wire for secondsPtype to set. - * @return This builder for chaining. - */ - public Builder setSecondsPtypeValue(int value) { - secondsPtype_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return The secondsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSecondsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(secondsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @param value The secondsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setSecondsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - secondsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType seconds_ptype = 2; - * - * @return This builder for chaining. - */ - public Builder clearSecondsPtype() { - bitField0_ = (bitField0_ & ~0x00000002); - secondsPtype_ = 0; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The enum numeric value on the wire for subsecondsPtype. - */ - @java.lang.Override - public int getSubsecondsPtypeValue() { - return subsecondsPtype_; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @param value The enum numeric value on the wire for subsecondsPtype to set. - * @return This builder for chaining. - */ - public Builder setSubsecondsPtypeValue(int value) { - subsecondsPtype_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return The subsecondsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSubsecondsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(subsecondsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @param value The subsecondsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setSubsecondsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - subsecondsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType subseconds_ptype = 3; - * - * @return This builder for chaining. - */ - public Builder clearSubsecondsPtype() { - bitField0_ = (bitField0_ & ~0x00000004); - subsecondsPtype_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.DateTimePartsMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ZstdFrameMetadata} - */ - public static final class ZstdFrameMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ZstdFrameMetadata) - ZstdFrameMetadataOrBuilder { - public static final int UNCOMPRESSED_SIZE_FIELD_NUMBER = 1; - public static final int N_VALUES_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ZstdFrameMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ZstdFrameMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ZstdFrameMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata(); - } - - private long uncompressedSize_ = 0L; - private long nValues_ = 0L; - private byte memoizedIsInitialized = -1; - - // Use ZstdFrameMetadata.newBuilder() to construct. - private ZstdFrameMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ZstdFrameMetadata() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder.class); - } - - /** - * uint64 uncompressed_size = 1; - * - * @return The uncompressedSize. - */ - @java.lang.Override - public long getUncompressedSize() { - return uncompressedSize_; - } - - /** - * uint64 n_values = 2; - * - * @return The nValues. - */ - @java.lang.Override - public long getNValues() { - return nValues_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (uncompressedSize_ != 0L) { - output.writeUInt64(1, uncompressedSize_); - } - if (nValues_ != 0L) { - output.writeUInt64(2, nValues_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (uncompressedSize_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, uncompressedSize_); - } - if (nValues_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, nValues_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata) obj; - - if (getUncompressedSize() - != other.getUncompressedSize()) { - return false; - } - if (getNValues() - != other.getNValues()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + UNCOMPRESSED_SIZE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getUncompressedSize()); - hash = (37 * hash) + N_VALUES_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getNValues()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ZstdFrameMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ZstdFrameMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder { - private int bitField0_; - private long uncompressedSize_; - private long nValues_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - uncompressedSize_ = 0L; - nValues_ = 0L; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdFrameMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.uncompressedSize_ = uncompressedSize_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.nValues_ = nValues_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.getDefaultInstance()) { - return this; - } - if (other.getUncompressedSize() != 0L) { - setUncompressedSize(other.getUncompressedSize()); - } - if (other.getNValues() != 0L) { - setNValues(other.getNValues()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - uncompressedSize_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - nValues_ = input.readUInt64(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 uncompressed_size = 1; - * - * @return The uncompressedSize. - */ - @java.lang.Override - public long getUncompressedSize() { - return uncompressedSize_; - } - - /** - * uint64 uncompressed_size = 1; - * - * @param value The uncompressedSize to set. - * @return This builder for chaining. - */ - public Builder setUncompressedSize(long value) { - - uncompressedSize_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 uncompressed_size = 1; - * - * @return This builder for chaining. - */ - public Builder clearUncompressedSize() { - bitField0_ = (bitField0_ & ~0x00000001); - uncompressedSize_ = 0L; - onChanged(); - return this; - } - - /** - * uint64 n_values = 2; - * - * @return The nValues. - */ - @java.lang.Override - public long getNValues() { - return nValues_; - } - - /** - * uint64 n_values = 2; - * - * @param value The nValues to set. - * @return This builder for chaining. - */ - public Builder setNValues(long value) { - - nValues_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint64 n_values = 2; - * - * @return This builder for chaining. - */ - public Builder clearNValues() { - bitField0_ = (bitField0_ & ~0x00000002); - nValues_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ZstdFrameMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ZstdMetadata} - */ - public static final class ZstdMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ZstdMetadata) - ZstdMetadataOrBuilder { - public static final int DICTIONARY_SIZE_FIELD_NUMBER = 1; - public static final int FRAMES_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ZstdMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ZstdMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ZstdMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata(); - } - - private int dictionarySize_ = 0; - @SuppressWarnings("serial") - private java.util.List frames_; - private byte memoizedIsInitialized = -1; - - // Use ZstdMetadata.newBuilder() to construct. - private ZstdMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ZstdMetadata() { - frames_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.Builder.class); - } - - /** - * uint32 dictionary_size = 1; - * - * @return The dictionarySize. - */ - @java.lang.Override - public int getDictionarySize() { - return dictionarySize_; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - @java.lang.Override - public java.util.List getFramesList() { - return frames_; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - @java.lang.Override - public java.util.List - getFramesOrBuilderList() { - return frames_; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - @java.lang.Override - public int getFramesCount() { - return frames_.size(); - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getFrames(int index) { - return frames_.get(index); - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder getFramesOrBuilder( - int index) { - return frames_.get(index); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (dictionarySize_ != 0) { - output.writeUInt32(1, dictionarySize_); - } - for (int i = 0; i < frames_.size(); i++) { - output.writeMessage(2, frames_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (dictionarySize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, dictionarySize_); - } - - { - final int count = frames_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(frames_.get(i)); - } - size += 1 * count; - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata) obj; - - if (getDictionarySize() - != other.getDictionarySize()) { - return false; - } - if (!getFramesList() - .equals(other.getFramesList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + DICTIONARY_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getDictionarySize(); - if (getFramesCount() > 0) { - hash = (37 * hash) + FRAMES_FIELD_NUMBER; - hash = (53 * hash) + getFramesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ZstdMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ZstdMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadataOrBuilder { - private int bitField0_; - private int dictionarySize_; - private java.util.List frames_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder> framesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - dictionarySize_ = 0; - if (framesBuilder_ == null) { - frames_ = java.util.Collections.emptyList(); - } else { - frames_ = null; - framesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ZstdMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata result) { - if (framesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - frames_ = java.util.Collections.unmodifiableList(frames_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.frames_ = frames_; - } else { - result.frames_ = framesBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.dictionarySize_ = dictionarySize_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ZstdMetadata.getDefaultInstance()) { - return this; - } - if (other.getDictionarySize() != 0) { - setDictionarySize(other.getDictionarySize()); - } - if (framesBuilder_ == null) { - if (!other.frames_.isEmpty()) { - if (frames_.isEmpty()) { - frames_ = other.frames_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureFramesIsMutable(); - frames_.addAll(other.frames_); - } - onChanged(); - } - } else { - if (!other.frames_.isEmpty()) { - if (framesBuilder_.isEmpty()) { - framesBuilder_.dispose(); - framesBuilder_ = null; - frames_ = other.frames_; - bitField0_ = (bitField0_ & ~0x00000002); - framesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetFramesFieldBuilder() : null; - } else { - framesBuilder_.addAllMessages(other.frames_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - dictionarySize_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 18: { - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata m = - input.readMessage( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.parser(), - extensionRegistry); - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.add(m); - } else { - framesBuilder_.addMessage(m); - } - break; - } // case 18 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 dictionary_size = 1; - * - * @return The dictionarySize. - */ - @java.lang.Override - public int getDictionarySize() { - return dictionarySize_; - } - - /** - * uint32 dictionary_size = 1; - * - * @param value The dictionarySize to set. - * @return This builder for chaining. - */ - public Builder setDictionarySize(int value) { - - dictionarySize_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 dictionary_size = 1; - * - * @return This builder for chaining. - */ - public Builder clearDictionarySize() { - bitField0_ = (bitField0_ & ~0x00000001); - dictionarySize_ = 0; - onChanged(); - return this; - } - - private void ensureFramesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - frames_ = new java.util.ArrayList(frames_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public java.util.List getFramesList() { - if (framesBuilder_ == null) { - return java.util.Collections.unmodifiableList(frames_); - } else { - return framesBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public int getFramesCount() { - if (framesBuilder_ == null) { - return frames_.size(); - } else { - return framesBuilder_.getCount(); - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata getFrames(int index) { - if (framesBuilder_ == null) { - return frames_.get(index); - } else { - return framesBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder setFrames( - int index, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.set(index, value); - onChanged(); - } else { - framesBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder setFrames( - int index, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.set(index, builderForValue.build()); - onChanged(); - } else { - framesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder addFrames(io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.add(value); - onChanged(); - } else { - framesBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder addFrames( - int index, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata value) { - if (framesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFramesIsMutable(); - frames_.add(index, value); - onChanged(); - } else { - framesBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder addFrames( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.add(builderForValue.build()); - onChanged(); - } else { - framesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder addFrames( - int index, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder builderForValue) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.add(index, builderForValue.build()); - onChanged(); - } else { - framesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder addAllFrames( - java.lang.Iterable values) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, frames_); - onChanged(); - } else { - framesBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder clearFrames() { - if (framesBuilder_ == null) { - frames_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - framesBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public Builder removeFrames(int index) { - if (framesBuilder_ == null) { - ensureFramesIsMutable(); - frames_.remove(index); - onChanged(); - } else { - framesBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder getFramesBuilder( - int index) { - return internalGetFramesFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder getFramesOrBuilder( - int index) { - if (framesBuilder_ == null) { - return frames_.get(index); - } else { - return framesBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public java.util.List - getFramesOrBuilderList() { - if (framesBuilder_ != null) { - return framesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(frames_); - } - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder addFramesBuilder() { - return internalGetFramesFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder addFramesBuilder( - int index) { - return internalGetFramesFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.ZstdFrameMetadata frames = 2; - */ - public java.util.List - getFramesBuilderList() { - return internalGetFramesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder> - internalGetFramesFieldBuilder() { - if (framesBuilder_ == null) { - framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.ZstdFrameMetadataOrBuilder>( - frames_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - frames_ = null; - } - return framesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ZstdMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.RLEMetadata} - */ - public static final class RLEMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.RLEMetadata) - RLEMetadataOrBuilder { - public static final int VALUES_LEN_FIELD_NUMBER = 1; - public static final int INDICES_LEN_FIELD_NUMBER = 2; - public static final int INDICES_PTYPE_FIELD_NUMBER = 3; - public static final int VALUES_IDX_OFFSETS_LEN_FIELD_NUMBER = 4; - public static final int VALUES_IDX_OFFSETS_PTYPE_FIELD_NUMBER = 5; - public static final int OFFSET_FIELD_NUMBER = 6; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.RLEMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RLEMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "RLEMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata(); - } - - private long valuesLen_ = 0L; - private long indicesLen_ = 0L; - private int indicesPtype_ = 0; - private long valuesIdxOffsetsLen_ = 0L; - private int valuesIdxOffsetsPtype_ = 0; - private long offset_ = 0L; - private byte memoizedIsInitialized = -1; - - // Use RLEMetadata.newBuilder() to construct. - private RLEMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private RLEMetadata() { - indicesPtype_ = 0; - valuesIdxOffsetsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.Builder.class); - } - - /** - * uint64 values_len = 1; - * - * @return The valuesLen. - */ - @java.lang.Override - public long getValuesLen() { - return valuesLen_; - } - - /** - * uint64 indices_len = 2; - * - * @return The indicesLen. - */ - @java.lang.Override - public long getIndicesLen() { - return indicesLen_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - @java.lang.Override - public int getIndicesPtypeValue() { - return indicesPtype_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(indicesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * uint64 values_idx_offsets_len = 4; - * - * @return The valuesIdxOffsetsLen. - */ - @java.lang.Override - public long getValuesIdxOffsetsLen() { - return valuesIdxOffsetsLen_; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for valuesIdxOffsetsPtype. - */ - @java.lang.Override - public int getValuesIdxOffsetsPtypeValue() { - return valuesIdxOffsetsPtype_; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The valuesIdxOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getValuesIdxOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(valuesIdxOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * uint64 offset = 6; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (valuesLen_ != 0L) { - output.writeUInt64(1, valuesLen_); - } - if (indicesLen_ != 0L) { - output.writeUInt64(2, indicesLen_); - } - if (indicesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(3, indicesPtype_); - } - if (valuesIdxOffsetsLen_ != 0L) { - output.writeUInt64(4, valuesIdxOffsetsLen_); - } - if (valuesIdxOffsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(5, valuesIdxOffsetsPtype_); - } - if (offset_ != 0L) { - output.writeUInt64(6, offset_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (valuesLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, valuesLen_); - } - if (indicesLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, indicesLen_); - } - if (indicesPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, indicesPtype_); - } - if (valuesIdxOffsetsLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(4, valuesIdxOffsetsLen_); - } - if (valuesIdxOffsetsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, valuesIdxOffsetsPtype_); - } - if (offset_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, offset_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata) obj; - - if (getValuesLen() - != other.getValuesLen()) { - return false; - } - if (getIndicesLen() - != other.getIndicesLen()) { - return false; - } - if (indicesPtype_ != other.indicesPtype_) { - return false; - } - if (getValuesIdxOffsetsLen() - != other.getValuesIdxOffsetsLen()) { - return false; - } - if (valuesIdxOffsetsPtype_ != other.valuesIdxOffsetsPtype_) { - return false; - } - if (getOffset() - != other.getOffset()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUES_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getValuesLen()); - hash = (37 * hash) + INDICES_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getIndicesLen()); - hash = (37 * hash) + INDICES_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + indicesPtype_; - hash = (37 * hash) + VALUES_IDX_OFFSETS_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getValuesIdxOffsetsLen()); - hash = (37 * hash) + VALUES_IDX_OFFSETS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + valuesIdxOffsetsPtype_; - hash = (37 * hash) + OFFSET_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getOffset()); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.RLEMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.RLEMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadataOrBuilder { - private int bitField0_; - private long valuesLen_; - private long indicesLen_; - private int indicesPtype_ = 0; - private long valuesIdxOffsetsLen_; - private int valuesIdxOffsetsPtype_ = 0; - private long offset_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - valuesLen_ = 0L; - indicesLen_ = 0L; - indicesPtype_ = 0; - valuesIdxOffsetsLen_ = 0L; - valuesIdxOffsetsPtype_ = 0; - offset_ = 0L; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_RLEMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.valuesLen_ = valuesLen_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.indicesLen_ = indicesLen_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.indicesPtype_ = indicesPtype_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.valuesIdxOffsetsLen_ = valuesIdxOffsetsLen_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.valuesIdxOffsetsPtype_ = valuesIdxOffsetsPtype_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.offset_ = offset_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.RLEMetadata.getDefaultInstance()) { - return this; - } - if (other.getValuesLen() != 0L) { - setValuesLen(other.getValuesLen()); - } - if (other.getIndicesLen() != 0L) { - setIndicesLen(other.getIndicesLen()); - } - if (other.indicesPtype_ != 0) { - setIndicesPtypeValue(other.getIndicesPtypeValue()); - } - if (other.getValuesIdxOffsetsLen() != 0L) { - setValuesIdxOffsetsLen(other.getValuesIdxOffsetsLen()); - } - if (other.valuesIdxOffsetsPtype_ != 0) { - setValuesIdxOffsetsPtypeValue(other.getValuesIdxOffsetsPtypeValue()); - } - if (other.getOffset() != 0L) { - setOffset(other.getOffset()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - valuesLen_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - indicesLen_ = input.readUInt64(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - indicesPtype_ = input.readEnum(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 32: { - valuesIdxOffsetsLen_ = input.readUInt64(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 40: { - valuesIdxOffsetsPtype_ = input.readEnum(); - bitField0_ |= 0x00000010; - break; - } // case 40 - case 48: { - offset_ = input.readUInt64(); - bitField0_ |= 0x00000020; - break; - } // case 48 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 values_len = 1; - * - * @return The valuesLen. - */ - @java.lang.Override - public long getValuesLen() { - return valuesLen_; - } - - /** - * uint64 values_len = 1; - * - * @param value The valuesLen to set. - * @return This builder for chaining. - */ - public Builder setValuesLen(long value) { - - valuesLen_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 values_len = 1; - * - * @return This builder for chaining. - */ - public Builder clearValuesLen() { - bitField0_ = (bitField0_ & ~0x00000001); - valuesLen_ = 0L; - onChanged(); - return this; - } - - /** - * uint64 indices_len = 2; - * - * @return The indicesLen. - */ - @java.lang.Override - public long getIndicesLen() { - return indicesLen_; - } - - /** - * uint64 indices_len = 2; - * - * @param value The indicesLen to set. - * @return This builder for chaining. - */ - public Builder setIndicesLen(long value) { - - indicesLen_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint64 indices_len = 2; - * - * @return This builder for chaining. - */ - public Builder clearIndicesLen() { - bitField0_ = (bitField0_ & ~0x00000002); - indicesLen_ = 0L; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The enum numeric value on the wire for indicesPtype. - */ - @java.lang.Override - public int getIndicesPtypeValue() { - return indicesPtype_; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @param value The enum numeric value on the wire for indicesPtype to set. - * @return This builder for chaining. - */ - public Builder setIndicesPtypeValue(int value) { - indicesPtype_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return The indicesPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getIndicesPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(indicesPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @param value The indicesPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setIndicesPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - indicesPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType indices_ptype = 3; - * - * @return This builder for chaining. - */ - public Builder clearIndicesPtype() { - bitField0_ = (bitField0_ & ~0x00000004); - indicesPtype_ = 0; - onChanged(); - return this; - } - - /** - * uint64 values_idx_offsets_len = 4; - * - * @return The valuesIdxOffsetsLen. - */ - @java.lang.Override - public long getValuesIdxOffsetsLen() { - return valuesIdxOffsetsLen_; - } - - /** - * uint64 values_idx_offsets_len = 4; - * - * @param value The valuesIdxOffsetsLen to set. - * @return This builder for chaining. - */ - public Builder setValuesIdxOffsetsLen(long value) { - - valuesIdxOffsetsLen_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - /** - * uint64 values_idx_offsets_len = 4; - * - * @return This builder for chaining. - */ - public Builder clearValuesIdxOffsetsLen() { - bitField0_ = (bitField0_ & ~0x00000008); - valuesIdxOffsetsLen_ = 0L; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The enum numeric value on the wire for valuesIdxOffsetsPtype. - */ - @java.lang.Override - public int getValuesIdxOffsetsPtypeValue() { - return valuesIdxOffsetsPtype_; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @param value The enum numeric value on the wire for valuesIdxOffsetsPtype to set. - * @return This builder for chaining. - */ - public Builder setValuesIdxOffsetsPtypeValue(int value) { - valuesIdxOffsetsPtype_ = value; - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return The valuesIdxOffsetsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getValuesIdxOffsetsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(valuesIdxOffsetsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @param value The valuesIdxOffsetsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setValuesIdxOffsetsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - valuesIdxOffsetsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType values_idx_offsets_ptype = 5; - * - * @return This builder for chaining. - */ - public Builder clearValuesIdxOffsetsPtype() { - bitField0_ = (bitField0_ & ~0x00000010); - valuesIdxOffsetsPtype_ = 0; - onChanged(); - return this; - } - - /** - * uint64 offset = 6; - * - * @return The offset. - */ - @java.lang.Override - public long getOffset() { - return offset_; - } - - /** - * uint64 offset = 6; - * - * @param value The offset to set. - * @return This builder for chaining. - */ - public Builder setOffset(long value) { - - offset_ = value; - bitField0_ |= 0x00000020; - onChanged(); - return this; - } - - /** - * uint64 offset = 6; - * - * @return This builder for chaining. - */ - public Builder clearOffset() { - bitField0_ = (bitField0_ & ~0x00000020); - offset_ = 0L; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.RLEMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ListMetadata} - */ - public static final class ListMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ListMetadata) - ListMetadataOrBuilder { - public static final int ELEMENTS_LEN_FIELD_NUMBER = 1; - public static final int OFFSET_PTYPE_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ListMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ListMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata(); - } - - private long elementsLen_ = 0L; - private int offsetPtype_ = 0; - private byte memoizedIsInitialized = -1; - - // Use ListMetadata.newBuilder() to construct. - private ListMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ListMetadata() { - offsetPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.Builder.class); - } - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - @java.lang.Override - public long getElementsLen() { - return elementsLen_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - @java.lang.Override - public int getOffsetPtypeValue() { - return offsetPtype_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (elementsLen_ != 0L) { - output.writeUInt64(1, elementsLen_); - } - if (offsetPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(2, offsetPtype_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (elementsLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, elementsLen_); - } - if (offsetPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, offsetPtype_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata) obj; - - if (getElementsLen() - != other.getElementsLen()) { - return false; - } - if (offsetPtype_ != other.offsetPtype_) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ELEMENTS_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getElementsLen()); - hash = (37 * hash) + OFFSET_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + offsetPtype_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ListMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ListMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadataOrBuilder { - private int bitField0_; - private long elementsLen_; - private int offsetPtype_ = 0; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - elementsLen_ = 0L; - offsetPtype_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.elementsLen_ = elementsLen_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.offsetPtype_ = offsetPtype_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ListMetadata.getDefaultInstance()) { - return this; - } - if (other.getElementsLen() != 0L) { - setElementsLen(other.getElementsLen()); - } - if (other.offsetPtype_ != 0) { - setOffsetPtypeValue(other.getOffsetPtypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - elementsLen_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - offsetPtype_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - @java.lang.Override - public long getElementsLen() { - return elementsLen_; - } - - /** - * uint64 elements_len = 1; - * - * @param value The elementsLen to set. - * @return This builder for chaining. - */ - public Builder setElementsLen(long value) { - - elementsLen_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 elements_len = 1; - * - * @return This builder for chaining. - */ - public Builder clearElementsLen() { - bitField0_ = (bitField0_ & ~0x00000001); - elementsLen_ = 0L; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - @java.lang.Override - public int getOffsetPtypeValue() { - return offsetPtype_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @param value The enum numeric value on the wire for offsetPtype to set. - * @return This builder for chaining. - */ - public Builder setOffsetPtypeValue(int value) { - offsetPtype_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @param value The offsetPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setOffsetPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - offsetPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return This builder for chaining. - */ - public Builder clearOffsetPtype() { - bitField0_ = (bitField0_ & ~0x00000002); - offsetPtype_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ListMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ListViewMetadata} - */ - public static final class ListViewMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ListViewMetadata) - ListViewMetadataOrBuilder { - public static final int ELEMENTS_LEN_FIELD_NUMBER = 1; - public static final int OFFSET_PTYPE_FIELD_NUMBER = 2; - public static final int SIZE_PTYPE_FIELD_NUMBER = 3; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ListViewMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListViewMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ListViewMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata(); - } - - private long elementsLen_ = 0L; - private int offsetPtype_ = 0; - private int sizePtype_ = 0; - private byte memoizedIsInitialized = -1; - - // Use ListViewMetadata.newBuilder() to construct. - private ListViewMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ListViewMetadata() { - offsetPtype_ = 0; - sizePtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.Builder.class); - } - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - @java.lang.Override - public long getElementsLen() { - return elementsLen_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - @java.lang.Override - public int getOffsetPtypeValue() { - return offsetPtype_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The enum numeric value on the wire for sizePtype. - */ - @java.lang.Override - public int getSizePtypeValue() { - return sizePtype_; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The sizePtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSizePtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(sizePtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (elementsLen_ != 0L) { - output.writeUInt64(1, elementsLen_); - } - if (offsetPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(2, offsetPtype_); - } - if (sizePtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(3, sizePtype_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (elementsLen_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, elementsLen_); - } - if (offsetPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, offsetPtype_); - } - if (sizePtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, sizePtype_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata) obj; - - if (getElementsLen() - != other.getElementsLen()) { - return false; - } - if (offsetPtype_ != other.offsetPtype_) { - return false; - } - if (sizePtype_ != other.sizePtype_) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ELEMENTS_LEN_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getElementsLen()); - hash = (37 * hash) + OFFSET_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + offsetPtype_; - hash = (37 * hash) + SIZE_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + sizePtype_; - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ListViewMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ListViewMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadataOrBuilder { - private int bitField0_; - private long elementsLen_; - private int offsetPtype_ = 0; - private int sizePtype_ = 0; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - elementsLen_ = 0L; - offsetPtype_ = 0; - sizePtype_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ListViewMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.elementsLen_ = elementsLen_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.offsetPtype_ = offsetPtype_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.sizePtype_ = sizePtype_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ListViewMetadata.getDefaultInstance()) { - return this; - } - if (other.getElementsLen() != 0L) { - setElementsLen(other.getElementsLen()); - } - if (other.offsetPtype_ != 0) { - setOffsetPtypeValue(other.getOffsetPtypeValue()); - } - if (other.sizePtype_ != 0) { - setSizePtypeValue(other.getSizePtypeValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - elementsLen_ = input.readUInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - offsetPtype_ = input.readEnum(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - sizePtype_ = input.readEnum(); - bitField0_ |= 0x00000004; - break; - } // case 24 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint64 elements_len = 1; - * - * @return The elementsLen. - */ - @java.lang.Override - public long getElementsLen() { - return elementsLen_; - } - - /** - * uint64 elements_len = 1; - * - * @param value The elementsLen to set. - * @return This builder for chaining. - */ - public Builder setElementsLen(long value) { - - elementsLen_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint64 elements_len = 1; - * - * @return This builder for chaining. - */ - public Builder clearElementsLen() { - bitField0_ = (bitField0_ & ~0x00000001); - elementsLen_ = 0L; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The enum numeric value on the wire for offsetPtype. - */ - @java.lang.Override - public int getOffsetPtypeValue() { - return offsetPtype_; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @param value The enum numeric value on the wire for offsetPtype to set. - * @return This builder for chaining. - */ - public Builder setOffsetPtypeValue(int value) { - offsetPtype_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return The offsetPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getOffsetPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(offsetPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @param value The offsetPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setOffsetPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - offsetPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType offset_ptype = 2; - * - * @return This builder for chaining. - */ - public Builder clearOffsetPtype() { - bitField0_ = (bitField0_ & ~0x00000002); - offsetPtype_ = 0; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The enum numeric value on the wire for sizePtype. - */ - @java.lang.Override - public int getSizePtypeValue() { - return sizePtype_; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @param value The enum numeric value on the wire for sizePtype to set. - * @return This builder for chaining. - */ - public Builder setSizePtypeValue(int value) { - sizePtype_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return The sizePtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getSizePtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(sizePtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @param value The sizePtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setSizePtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - sizePtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType size_ptype = 3; - * - * @return This builder for chaining. - */ - public Builder clearSizePtype() { - bitField0_ = (bitField0_ & ~0x00000004); - sizePtype_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ListViewMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.ALPRDMetadata} - */ - public static final class ALPRDMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.ALPRDMetadata) - ALPRDMetadataOrBuilder { - public static final int RIGHT_BIT_WIDTH_FIELD_NUMBER = 1; - public static final int DICT_LEN_FIELD_NUMBER = 2; - public static final int DICT_FIELD_NUMBER = 3; - public static final int LEFT_PARTS_PTYPE_FIELD_NUMBER = 4; - public static final int PATCHES_FIELD_NUMBER = 5; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.ALPRDMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ALPRDMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ALPRDMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata(); - } - - private int bitField0_; - private int rightBitWidth_ = 0; - private int dictLen_ = 0; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.IntList dict_ = - emptyIntList(); - private int dictMemoizedSerializedSize = -1; - private int leftPartsPtype_ = 0; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private byte memoizedIsInitialized = -1; - - // Use ALPRDMetadata.newBuilder() to construct. - private ALPRDMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ALPRDMetadata() { - dict_ = emptyIntList(); - leftPartsPtype_ = 0; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.Builder.class); - } - - /** - * uint32 right_bit_width = 1; - * - * @return The rightBitWidth. - */ - @java.lang.Override - public int getRightBitWidth() { - return rightBitWidth_; - } - - /** - * uint32 dict_len = 2; - * - * @return The dictLen. - */ - @java.lang.Override - public int getDictLen() { - return dictLen_; - } - - /** - * repeated uint32 dict = 3; - * - * @return A list containing the dict. - */ - @java.lang.Override - public java.util.List - getDictList() { - return dict_; - } - - /** - * repeated uint32 dict = 3; - * - * @return The count of dict. - */ - public int getDictCount() { - return dict_.size(); - } - - /** - * repeated uint32 dict = 3; - * - * @param index The index of the element to return. - * @return The dict at the given index. - */ - public int getDict(int index) { - return dict_.getInt(index); - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The enum numeric value on the wire for leftPartsPtype. - */ - @java.lang.Override - public int getLeftPartsPtypeValue() { - return leftPartsPtype_; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The leftPartsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getLeftPartsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(leftPartsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return Whether the patches field is set. - */ - @java.lang.Override - public boolean hasPatches() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return The patches. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (rightBitWidth_ != 0) { - output.writeUInt32(1, rightBitWidth_); - } - if (dictLen_ != 0) { - output.writeUInt32(2, dictLen_); - } - if (getDictList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(dictMemoizedSerializedSize); - } - for (int i = 0; i < dict_.size(); i++) { - output.writeUInt32NoTag(dict_.getInt(i)); - } - if (leftPartsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - output.writeEnum(4, leftPartsPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(5, getPatches()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (rightBitWidth_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, rightBitWidth_); - } - if (dictLen_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, dictLen_); - } - { - int dataSize = 0; - for (int i = 0; i < dict_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeUInt32SizeNoTag(dict_.getInt(i)); - } - size += dataSize; - if (!getDictList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - dictMemoizedSerializedSize = dataSize; - } - if (leftPartsPtype_ != io.github.dfa1.vortex.proto.DTypeProtos.PType.U8.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, leftPartsPtype_); - } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getPatches()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata) obj; - - if (getRightBitWidth() - != other.getRightBitWidth()) { - return false; - } - if (getDictLen() - != other.getDictLen()) { - return false; - } - if (!getDictList() - .equals(other.getDictList())) { - return false; - } - if (leftPartsPtype_ != other.leftPartsPtype_) { - return false; - } - if (hasPatches() != other.hasPatches()) { - return false; - } - if (hasPatches()) { - if (!getPatches() - .equals(other.getPatches())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + RIGHT_BIT_WIDTH_FIELD_NUMBER; - hash = (53 * hash) + getRightBitWidth(); - hash = (37 * hash) + DICT_LEN_FIELD_NUMBER; - hash = (53 * hash) + getDictLen(); - if (getDictCount() > 0) { - hash = (37 * hash) + DICT_FIELD_NUMBER; - hash = (53 * hash) + getDictList().hashCode(); - } - hash = (37 * hash) + LEFT_PARTS_PTYPE_FIELD_NUMBER; - hash = (53 * hash) + leftPartsPtype_; - if (hasPatches()) { - hash = (37 * hash) + PATCHES_FIELD_NUMBER; - hash = (53 * hash) + getPatches().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.ALPRDMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.ALPRDMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadataOrBuilder { - private int bitField0_; - private int rightBitWidth_; - private int dictLen_; - private com.google.protobuf.Internal.IntList dict_ = emptyIntList(); - private int leftPartsPtype_ = 0; - private io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata patches_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> patchesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetPatchesFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - rightBitWidth_ = 0; - dictLen_ = 0; - dict_ = emptyIntList(); - leftPartsPtype_ = 0; - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_ALPRDMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.rightBitWidth_ = rightBitWidth_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.dictLen_ = dictLen_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - dict_.makeImmutable(); - result.dict_ = dict_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.leftPartsPtype_ = leftPartsPtype_; - } - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000010) != 0)) { - result.patches_ = patchesBuilder_ == null - ? patches_ - : patchesBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.ALPRDMetadata.getDefaultInstance()) { - return this; - } - if (other.getRightBitWidth() != 0) { - setRightBitWidth(other.getRightBitWidth()); - } - if (other.getDictLen() != 0) { - setDictLen(other.getDictLen()); - } - if (!other.dict_.isEmpty()) { - if (dict_.isEmpty()) { - dict_ = other.dict_; - dict_.makeImmutable(); - bitField0_ |= 0x00000004; - } else { - ensureDictIsMutable(); - dict_.addAll(other.dict_); - } - onChanged(); - } - if (other.leftPartsPtype_ != 0) { - setLeftPartsPtypeValue(other.getLeftPartsPtypeValue()); - } - if (other.hasPatches()) { - mergePatches(other.getPatches()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - rightBitWidth_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - dictLen_ = input.readUInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - int v = input.readUInt32(); - ensureDictIsMutable(); - dict_.addInt(v); - break; - } // case 24 - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureDictIsMutable(); - while (input.getBytesUntilLimit() > 0) { - dict_.addInt(input.readUInt32()); - } - input.popLimit(limit); - break; - } // case 26 - case 32: { - leftPartsPtype_ = input.readEnum(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 42: { - input.readMessage( - internalGetPatchesFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 42 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 right_bit_width = 1; - * - * @return The rightBitWidth. - */ - @java.lang.Override - public int getRightBitWidth() { - return rightBitWidth_; - } - - /** - * uint32 right_bit_width = 1; - * - * @param value The rightBitWidth to set. - * @return This builder for chaining. - */ - public Builder setRightBitWidth(int value) { - - rightBitWidth_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 right_bit_width = 1; - * - * @return This builder for chaining. - */ - public Builder clearRightBitWidth() { - bitField0_ = (bitField0_ & ~0x00000001); - rightBitWidth_ = 0; - onChanged(); - return this; - } - - /** - * uint32 dict_len = 2; - * - * @return The dictLen. - */ - @java.lang.Override - public int getDictLen() { - return dictLen_; - } - - /** - * uint32 dict_len = 2; - * - * @param value The dictLen to set. - * @return This builder for chaining. - */ - public Builder setDictLen(int value) { - - dictLen_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * uint32 dict_len = 2; - * - * @return This builder for chaining. - */ - public Builder clearDictLen() { - bitField0_ = (bitField0_ & ~0x00000002); - dictLen_ = 0; - onChanged(); - return this; - } - - private void ensureDictIsMutable() { - if (!dict_.isModifiable()) { - dict_ = makeMutableCopy(dict_); - } - bitField0_ |= 0x00000004; - } - - /** - * repeated uint32 dict = 3; - * - * @return A list containing the dict. - */ - public java.util.List - getDictList() { - dict_.makeImmutable(); - return dict_; - } - - /** - * repeated uint32 dict = 3; - * - * @return The count of dict. - */ - public int getDictCount() { - return dict_.size(); - } - - /** - * repeated uint32 dict = 3; - * - * @param index The index of the element to return. - * @return The dict at the given index. - */ - public int getDict(int index) { - return dict_.getInt(index); - } - - /** - * repeated uint32 dict = 3; - * - * @param index The index to set the value at. - * @param value The dict to set. - * @return This builder for chaining. - */ - public Builder setDict( - int index, int value) { - - ensureDictIsMutable(); - dict_.setInt(index, value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * repeated uint32 dict = 3; - * - * @param value The dict to add. - * @return This builder for chaining. - */ - public Builder addDict(int value) { - - ensureDictIsMutable(); - dict_.addInt(value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * repeated uint32 dict = 3; - * - * @param values The dict to add. - * @return This builder for chaining. - */ - public Builder addAllDict( - java.lang.Iterable values) { - ensureDictIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, dict_); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - /** - * repeated uint32 dict = 3; - * - * @return This builder for chaining. - */ - public Builder clearDict() { - dict_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The enum numeric value on the wire for leftPartsPtype. - */ - @java.lang.Override - public int getLeftPartsPtypeValue() { - return leftPartsPtype_; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @param value The enum numeric value on the wire for leftPartsPtype to set. - * @return This builder for chaining. - */ - public Builder setLeftPartsPtypeValue(int value) { - leftPartsPtype_ = value; - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return The leftPartsPtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.PType getLeftPartsPtype() { - io.github.dfa1.vortex.proto.DTypeProtos.PType result = io.github.dfa1.vortex.proto.DTypeProtos.PType.forNumber(leftPartsPtype_); - return result == null ? io.github.dfa1.vortex.proto.DTypeProtos.PType.UNRECOGNIZED : result; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @param value The leftPartsPtype to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setLeftPartsPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - leftPartsPtype_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .vortex.dtype.PType left_parts_ptype = 4; - * - * @return This builder for chaining. - */ - public Builder clearLeftPartsPtype() { - bitField0_ = (bitField0_ & ~0x00000008); - leftPartsPtype_ = 0; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return Whether the patches field is set. - */ - public boolean hasPatches() { - return ((bitField0_ & 0x00000010) != 0); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - * - * @return The patches. - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata getPatches() { - if (patchesBuilder_ == null) { - return patches_ == null ? io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } else { - return patchesBuilder_.getMessage(); - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public Builder setPatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - patches_ = value; - } else { - patchesBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public Builder setPatches( - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder builderForValue) { - if (patchesBuilder_ == null) { - patches_ = builderForValue.build(); - } else { - patchesBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public Builder mergePatches(io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata value) { - if (patchesBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) && - patches_ != null && - patches_ != io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance()) { - getPatchesBuilder().mergeFrom(value); - } else { - patches_ = value; - } - } else { - patchesBuilder_.mergeFrom(value); - } - if (patches_ != null) { - bitField0_ |= 0x00000010; - onChanged(); - } - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public Builder clearPatches() { - bitField0_ = (bitField0_ & ~0x00000010); - patches_ = null; - if (patchesBuilder_ != null) { - patchesBuilder_.dispose(); - patchesBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder getPatchesBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return internalGetPatchesFieldBuilder().getBuilder(); - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder getPatchesOrBuilder() { - if (patchesBuilder_ != null) { - return patchesBuilder_.getMessageOrBuilder(); - } else { - return patches_ == null ? - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.getDefaultInstance() : patches_; - } - } - - /** - * optional .vortex.encodings.PatchesMetadata patches = 5; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder> - internalGetPatchesFieldBuilder() { - if (patchesBuilder_ == null) { - patchesBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadata.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PatchesMetadataOrBuilder>( - getPatches(), - getParentForChildren(), - isClean()); - patches_ = null; - } - return patchesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.ALPRDMetadata) - } - - } - - /** - * Protobuf type {@code vortex.encodings.PcoPageInfo} - */ - public static final class PcoPageInfo extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.PcoPageInfo) - PcoPageInfoOrBuilder { - public static final int N_VALUES_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.PcoPageInfo) - private static final io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PcoPageInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "PcoPageInfo"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo(); - } - - private int nValues_ = 0; - private byte memoizedIsInitialized = -1; - - // Use PcoPageInfo.newBuilder() to construct. - private PcoPageInfo(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private PcoPageInfo() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder.class); - } - - /** - * uint32 n_values = 1; - * - * @return The nValues. - */ - @java.lang.Override - public int getNValues() { - return nValues_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (nValues_ != 0) { - output.writeUInt32(1, nValues_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (nValues_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(1, nValues_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo other = (io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo) obj; - - if (getNValues() - != other.getNValues()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + N_VALUES_FIELD_NUMBER; - hash = (53 * hash) + getNValues(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.PcoPageInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.PcoPageInfo) - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder { - private int bitField0_; - private int nValues_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - nValues_ = 0; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoPageInfo_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo build() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo result = new io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.nValues_ = nValues_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.getDefaultInstance()) { - return this; - } - if (other.getNValues() != 0) { - setNValues(other.getNValues()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - nValues_ = input.readUInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * uint32 n_values = 1; - * - * @return The nValues. - */ - @java.lang.Override - public int getNValues() { - return nValues_; - } - - /** - * uint32 n_values = 1; - * - * @param value The nValues to set. - * @return This builder for chaining. - */ - public Builder setNValues(int value) { - - nValues_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * uint32 n_values = 1; - * - * @return This builder for chaining. - */ - public Builder clearNValues() { - bitField0_ = (bitField0_ & ~0x00000001); - nValues_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.PcoPageInfo) - } - - } - - /** - * Protobuf type {@code vortex.encodings.PcoChunkInfo} - */ - public static final class PcoChunkInfo extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.PcoChunkInfo) - PcoChunkInfoOrBuilder { - public static final int PAGES_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.PcoChunkInfo) - private static final io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PcoChunkInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "PcoChunkInfo"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo(); - } - - @SuppressWarnings("serial") - private java.util.List pages_; - private byte memoizedIsInitialized = -1; - - // Use PcoChunkInfo.newBuilder() to construct. - private PcoChunkInfo(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private PcoChunkInfo() { - pages_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder.class); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - @java.lang.Override - public java.util.List getPagesList() { - return pages_; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - @java.lang.Override - public java.util.List - getPagesOrBuilderList() { - return pages_; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - @java.lang.Override - public int getPagesCount() { - return pages_.size(); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getPages(int index) { - return pages_.get(index); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder getPagesOrBuilder( - int index) { - return pages_.get(index); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < pages_.size(); i++) { - output.writeMessage(1, pages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - - { - final int count = pages_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(pages_.get(i)); - } - size += 1 * count; - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo other = (io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo) obj; - - if (!getPagesList() - .equals(other.getPagesList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPagesCount() > 0) { - hash = (37 * hash) + PAGES_FIELD_NUMBER; - hash = (53 * hash) + getPagesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.PcoChunkInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.PcoChunkInfo) - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder { - private int bitField0_; - private java.util.List pages_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder> pagesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (pagesBuilder_ == null) { - pages_ = java.util.Collections.emptyList(); - } else { - pages_ = null; - pagesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoChunkInfo_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo build() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo result = new io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo result) { - if (pagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - pages_ = java.util.Collections.unmodifiableList(pages_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.pages_ = pages_; - } else { - result.pages_ = pagesBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo result) { - int from_bitField0_ = bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.getDefaultInstance()) { - return this; - } - if (pagesBuilder_ == null) { - if (!other.pages_.isEmpty()) { - if (pages_.isEmpty()) { - pages_ = other.pages_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePagesIsMutable(); - pages_.addAll(other.pages_); - } - onChanged(); - } - } else { - if (!other.pages_.isEmpty()) { - if (pagesBuilder_.isEmpty()) { - pagesBuilder_.dispose(); - pagesBuilder_ = null; - pages_ = other.pages_; - bitField0_ = (bitField0_ & ~0x00000001); - pagesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetPagesFieldBuilder() : null; - } else { - pagesBuilder_.addAllMessages(other.pages_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo m = - input.readMessage( - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.parser(), - extensionRegistry); - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - pages_.add(m); - } else { - pagesBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private void ensurePagesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - pages_ = new java.util.ArrayList(pages_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public java.util.List getPagesList() { - if (pagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(pages_); - } else { - return pagesBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public int getPagesCount() { - if (pagesBuilder_ == null) { - return pages_.size(); - } else { - return pagesBuilder_.getCount(); - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo getPages(int index) { - if (pagesBuilder_ == null) { - return pages_.get(index); - } else { - return pagesBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder setPages( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo value) { - if (pagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePagesIsMutable(); - pages_.set(index, value); - onChanged(); - } else { - pagesBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder setPages( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder builderForValue) { - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - pages_.set(index, builderForValue.build()); - onChanged(); - } else { - pagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder addPages(io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo value) { - if (pagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePagesIsMutable(); - pages_.add(value); - onChanged(); - } else { - pagesBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder addPages( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo value) { - if (pagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePagesIsMutable(); - pages_.add(index, value); - onChanged(); - } else { - pagesBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder addPages( - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder builderForValue) { - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - pages_.add(builderForValue.build()); - onChanged(); - } else { - pagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder addPages( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder builderForValue) { - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - pages_.add(index, builderForValue.build()); - onChanged(); - } else { - pagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder addAllPages( - java.lang.Iterable values) { - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, pages_); - onChanged(); - } else { - pagesBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder clearPages() { - if (pagesBuilder_ == null) { - pages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - pagesBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public Builder removePages(int index) { - if (pagesBuilder_ == null) { - ensurePagesIsMutable(); - pages_.remove(index); - onChanged(); - } else { - pagesBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder getPagesBuilder( - int index) { - return internalGetPagesFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder getPagesOrBuilder( - int index) { - if (pagesBuilder_ == null) { - return pages_.get(index); - } else { - return pagesBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public java.util.List - getPagesOrBuilderList() { - if (pagesBuilder_ != null) { - return pagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(pages_); - } - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder addPagesBuilder() { - return internalGetPagesFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder addPagesBuilder( - int index) { - return internalGetPagesFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.PcoPageInfo pages = 1; - */ - public java.util.List - getPagesBuilderList() { - return internalGetPagesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder> - internalGetPagesFieldBuilder() { - if (pagesBuilder_ == null) { - pagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoPageInfoOrBuilder>( - pages_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - pages_ = null; - } - return pagesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.PcoChunkInfo) - } - - } - - /** - * Protobuf type {@code vortex.encodings.PcoMetadata} - */ - public static final class PcoMetadata extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.encodings.PcoMetadata) - PcoMetadataOrBuilder { - public static final int HEADER_FIELD_NUMBER = 1; - public static final int CHUNKS_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.encodings.PcoMetadata) - private static final io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PcoMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "PcoMetadata"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata(); - } - - private com.google.protobuf.ByteString header_ = com.google.protobuf.ByteString.EMPTY; - @SuppressWarnings("serial") - private java.util.List chunks_; - private byte memoizedIsInitialized = -1; - - // Use PcoMetadata.newBuilder() to construct. - private PcoMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private PcoMetadata() { - header_ = com.google.protobuf.ByteString.EMPTY; - chunks_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_descriptor; - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.Builder.class); - } - - /** - * bytes header = 1; - * - * @return The header. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHeader() { - return header_; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - @java.lang.Override - public java.util.List getChunksList() { - return chunks_; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - @java.lang.Override - public java.util.List - getChunksOrBuilderList() { - return chunks_; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - @java.lang.Override - public int getChunksCount() { - return chunks_.size(); - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getChunks(int index) { - return chunks_.get(index); - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder getChunksOrBuilder( - int index) { - return chunks_.get(index); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!header_.isEmpty()) { - output.writeBytes(1, header_); - } - for (int i = 0; i < chunks_.size(); i++) { - output.writeMessage(2, chunks_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (!header_.isEmpty()) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, header_); - } - - { - final int count = chunks_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(chunks_.get(i)); - } - size += 1 * count; - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata other = (io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata) obj; - - if (!getHeader() - .equals(other.getHeader())) { - return false; - } - if (!getChunksList() - .equals(other.getChunksList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + HEADER_FIELD_NUMBER; - hash = (53 * hash) + getHeader().hashCode(); - if (getChunksCount() > 0) { - hash = (37 * hash) + CHUNKS_FIELD_NUMBER; - hash = (53 * hash) + getChunksList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.encodings.PcoMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.encodings.PcoMetadata) - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadataOrBuilder { - private int bitField0_; - private com.google.protobuf.ByteString header_ = com.google.protobuf.ByteString.EMPTY; - private java.util.List chunks_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder> chunksBuilder_; - - // Construct using io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.class, io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - header_ = com.google.protobuf.ByteString.EMPTY; - if (chunksBuilder_ == null) { - chunks_ = java.util.Collections.emptyList(); - } else { - chunks_ = null; - chunksBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.internal_static_vortex_encodings_PcoMetadata_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata build() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata buildPartial() { - io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata result = new io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata result) { - if (chunksBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - chunks_ = java.util.Collections.unmodifiableList(chunks_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.chunks_ = chunks_; - } else { - result.chunks_ = chunksBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata result) { - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.header_ = header_; - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata) { - return mergeFrom((io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata other) { - if (other == io.github.dfa1.vortex.proto.EncodingProtos.PcoMetadata.getDefaultInstance()) { - return this; - } - if (!other.getHeader().isEmpty()) { - setHeader(other.getHeader()); - } - if (chunksBuilder_ == null) { - if (!other.chunks_.isEmpty()) { - if (chunks_.isEmpty()) { - chunks_ = other.chunks_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureChunksIsMutable(); - chunks_.addAll(other.chunks_); - } - onChanged(); - } - } else { - if (!other.chunks_.isEmpty()) { - if (chunksBuilder_.isEmpty()) { - chunksBuilder_.dispose(); - chunksBuilder_ = null; - chunks_ = other.chunks_; - bitField0_ = (bitField0_ & ~0x00000002); - chunksBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetChunksFieldBuilder() : null; - } else { - chunksBuilder_.addAllMessages(other.chunks_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - header_ = input.readBytes(); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: { - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo m = - input.readMessage( - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.parser(), - extensionRegistry); - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - chunks_.add(m); - } else { - chunksBuilder_.addMessage(m); - } - break; - } // case 18 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * bytes header = 1; - * - * @return The header. - */ - @java.lang.Override - public com.google.protobuf.ByteString getHeader() { - return header_; - } - - /** - * bytes header = 1; - * - * @param value The header to set. - * @return This builder for chaining. - */ - public Builder setHeader(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - header_ = value; - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * bytes header = 1; - * - * @return This builder for chaining. - */ - public Builder clearHeader() { - bitField0_ = (bitField0_ & ~0x00000001); - header_ = getDefaultInstance().getHeader(); - onChanged(); - return this; - } - - private void ensureChunksIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - chunks_ = new java.util.ArrayList(chunks_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public java.util.List getChunksList() { - if (chunksBuilder_ == null) { - return java.util.Collections.unmodifiableList(chunks_); - } else { - return chunksBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public int getChunksCount() { - if (chunksBuilder_ == null) { - return chunks_.size(); - } else { - return chunksBuilder_.getCount(); - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo getChunks(int index) { - if (chunksBuilder_ == null) { - return chunks_.get(index); - } else { - return chunksBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder setChunks( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo value) { - if (chunksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunksIsMutable(); - chunks_.set(index, value); - onChanged(); - } else { - chunksBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder setChunks( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder builderForValue) { - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - chunks_.set(index, builderForValue.build()); - onChanged(); - } else { - chunksBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder addChunks(io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo value) { - if (chunksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunksIsMutable(); - chunks_.add(value); - onChanged(); - } else { - chunksBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder addChunks( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo value) { - if (chunksBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChunksIsMutable(); - chunks_.add(index, value); - onChanged(); - } else { - chunksBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder addChunks( - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder builderForValue) { - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - chunks_.add(builderForValue.build()); - onChanged(); - } else { - chunksBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder addChunks( - int index, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder builderForValue) { - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - chunks_.add(index, builderForValue.build()); - onChanged(); - } else { - chunksBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder addAllChunks( - java.lang.Iterable values) { - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, chunks_); - onChanged(); - } else { - chunksBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder clearChunks() { - if (chunksBuilder_ == null) { - chunks_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - chunksBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public Builder removeChunks(int index) { - if (chunksBuilder_ == null) { - ensureChunksIsMutable(); - chunks_.remove(index); - onChanged(); - } else { - chunksBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder getChunksBuilder( - int index) { - return internalGetChunksFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder getChunksOrBuilder( - int index) { - if (chunksBuilder_ == null) { - return chunks_.get(index); - } else { - return chunksBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public java.util.List - getChunksOrBuilderList() { - if (chunksBuilder_ != null) { - return chunksBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(chunks_); - } - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder addChunksBuilder() { - return internalGetChunksFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder addChunksBuilder( - int index) { - return internalGetChunksFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.getDefaultInstance()); - } - - /** - * repeated .vortex.encodings.PcoChunkInfo chunks = 2; - */ - public java.util.List - getChunksBuilderList() { - return internalGetChunksFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder> - internalGetChunksFieldBuilder() { - if (chunksBuilder_ == null) { - chunksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfo.Builder, io.github.dfa1.vortex.proto.EncodingProtos.PcoChunkInfoOrBuilder>( - chunks_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - chunks_ = null; - } - return chunksBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.encodings.PcoMetadata) - } - - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Extension.java b/core/src/main/java/io/github/dfa1/vortex/proto/Extension.java new file mode 100644 index 00000000..491700ca --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Extension.java @@ -0,0 +1,90 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import java.util.Arrays; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Extension}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param id field tag 1 +/// @param storage_dtype field tag 2 +/// @param metadata field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Extension( + String id, + DType storage_dtype, + byte[] metadata +) { + + /// Decodes a {@code vortex.dtype.Extension} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Extension decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + String id = ""; + DType storage_dtype = null; + byte[] metadata = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + id = r.readString(); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + storage_dtype = DType.decode(__slice, 0, __slice.byteSize()); + } + case 3 -> { + metadata = r.readBytes(); + } + default -> r.skipField(tag & 7); + } + } + return new Extension(id, storage_dtype, metadata); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (id != null && !id.isEmpty()) { + w.writeTag(1, 2); + w.writeString(id); + } + if (storage_dtype != null) { + w.writeTag(2, 2); + w.writeEmbedded(storage_dtype.encode()); + } + if (metadata != null) { + w.writeTag(3, 2); + w.writeBytes(metadata); + } + return w.toByteArray(); + } + + @Override + public boolean equals(Object __o) { + if (this == __o) { + return true; + } + if (!(__o instanceof Extension __that)) { + return false; + } + return java.util.Objects.equals(id, __that.id) + && java.util.Objects.equals(storage_dtype, __that.storage_dtype) + && java.util.Arrays.equals(metadata, __that.metadata); + } + + @Override + public int hashCode() { + int __h = 1; + __h = 31 * __h + java.util.Objects.hashCode(id); + __h = 31 * __h + java.util.Objects.hashCode(storage_dtype); + __h = 31 * __h + java.util.Arrays.hashCode(metadata); + return __h; + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/FSSTMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/FSSTMetadata.java new file mode 100644 index 00000000..8957a0c4 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/FSSTMetadata.java @@ -0,0 +1,66 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.FSSTMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param uncompressed_lengths_ptype field tag 1 +/// @param codes_offsets_ptype field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record FSSTMetadata( + PType uncompressed_lengths_ptype, + PType codes_offsets_ptype +) { + + /// Decodes a {@code vortex.encodings.FSSTMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static FSSTMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType uncompressed_lengths_ptype = PType.U8; + PType codes_offsets_ptype = PType.U8; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + uncompressed_lengths_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 2 -> { + int __ev = r.readVarint32(); + try { + codes_offsets_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + default -> r.skipField(tag & 7); + } + } + return new FSSTMetadata(uncompressed_lengths_ptype, codes_offsets_ptype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (uncompressed_lengths_ptype.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(uncompressed_lengths_ptype.value()); + } + if (codes_offsets_ptype.value() != 0) { + w.writeTag(2, 0); + w.writeVarint32(codes_offsets_ptype.value()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Field.java b/core/src/main/java/io/github/dfa1/vortex/proto/Field.java new file mode 100644 index 00000000..91e80284 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Field.java @@ -0,0 +1,53 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Field}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param name field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Field( + String name +) { + + /// Decodes a {@code vortex.dtype.Field} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Field decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + String name = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + name = r.readString(); + } + default -> r.skipField(tag & 7); + } + } + return new Field(name); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (name != null) { + w.writeTag(1, 2); + w.writeString(name); + } + return w.toByteArray(); + } + + /// Factory for oneof case {@code name} (field tag 1). + /// @param value the value to set + /// @return a record with only the {@code name} component set + public static Field ofName(String value) { + return new Field(value); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/FieldPath.java b/core/src/main/java/io/github/dfa1/vortex/proto/FieldPath.java new file mode 100644 index 00000000..5e2d2905 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/FieldPath.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.FieldPath}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param path field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record FieldPath( + java.util.List path +) { + + /// Decodes a {@code vortex.dtype.FieldPath} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static FieldPath decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + java.util.List path = new java.util.ArrayList<>(); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + path.add(Field.decode(__slice, 0, __slice.byteSize())); + } + default -> r.skipField(tag & 7); + } + } + return new FieldPath(path); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + for (Field __v : path) { + w.writeTag(1, 2); + w.writeEmbedded(__v.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/FixedSizeList.java b/core/src/main/java/io/github/dfa1/vortex/proto/FixedSizeList.java new file mode 100644 index 00000000..7b822c64 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/FixedSizeList.java @@ -0,0 +1,67 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.FixedSizeList}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param element_type field tag 1 +/// @param size field tag 2 +/// @param nullable field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record FixedSizeList( + DType element_type, + int size, + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.FixedSizeList} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static FixedSizeList decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + DType element_type = null; + int size = 0; + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + element_type = DType.decode(__slice, 0, __slice.byteSize()); + } + case 2 -> { + size = r.readVarint32(); + } + case 3 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new FixedSizeList(element_type, size, nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (element_type != null) { + w.writeTag(1, 2); + w.writeEmbedded(element_type.encode()); + } + if (size != 0) { + w.writeTag(2, 0); + w.writeVarint32(size); + } + if (nullable) { + w.writeTag(3, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/List.java b/core/src/main/java/io/github/dfa1/vortex/proto/List.java new file mode 100644 index 00000000..c0312942 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/List.java @@ -0,0 +1,57 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.List}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param element_type field tag 1 +/// @param nullable field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record List( + DType element_type, + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.List} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static List decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + DType element_type = null; + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + element_type = DType.decode(__slice, 0, __slice.byteSize()); + } + case 2 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new List(element_type, nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (element_type != null) { + w.writeTag(1, 2); + w.writeEmbedded(element_type.encode()); + } + if (nullable) { + w.writeTag(2, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ListMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ListMetadata.java new file mode 100644 index 00000000..04e771e8 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ListMetadata.java @@ -0,0 +1,61 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ListMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param elements_len field tag 1 +/// @param offset_ptype field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ListMetadata( + long elements_len, + PType offset_ptype +) { + + /// Decodes a {@code vortex.encodings.ListMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ListMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long elements_len = 0; + PType offset_ptype = PType.U8; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + elements_len = r.readVarint64(); + } + case 2 -> { + int __ev = r.readVarint32(); + try { + offset_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + default -> r.skipField(tag & 7); + } + } + return new ListMetadata(elements_len, offset_ptype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (elements_len != 0L) { + w.writeTag(1, 0); + w.writeVarint64(elements_len); + } + if (offset_ptype.value() != 0) { + w.writeTag(2, 0); + w.writeVarint32(offset_ptype.value()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ListValue.java b/core/src/main/java/io/github/dfa1/vortex/proto/ListValue.java new file mode 100644 index 00000000..4035edbe --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ListValue.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.scalar.ListValue}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param values field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ListValue( + java.util.List values +) { + + /// Decodes a {@code vortex.scalar.ListValue} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ListValue decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + java.util.List values = new java.util.ArrayList<>(); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + values.add(ScalarValue.decode(__slice, 0, __slice.byteSize())); + } + default -> r.skipField(tag & 7); + } + } + return new ListValue(values); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + for (ScalarValue __v : values) { + w.writeTag(1, 2); + w.writeEmbedded(__v.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ListViewMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ListViewMetadata.java new file mode 100644 index 00000000..e8001ffd --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ListViewMetadata.java @@ -0,0 +1,76 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ListViewMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param elements_len field tag 1 +/// @param offset_ptype field tag 2 +/// @param size_ptype field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ListViewMetadata( + long elements_len, + PType offset_ptype, + PType size_ptype +) { + + /// Decodes a {@code vortex.encodings.ListViewMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ListViewMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long elements_len = 0; + PType offset_ptype = PType.U8; + PType size_ptype = PType.U8; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + elements_len = r.readVarint64(); + } + case 2 -> { + int __ev = r.readVarint32(); + try { + offset_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 3 -> { + int __ev = r.readVarint32(); + try { + size_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + default -> r.skipField(tag & 7); + } + } + return new ListViewMetadata(elements_len, offset_ptype, size_ptype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (elements_len != 0L) { + w.writeTag(1, 0); + w.writeVarint64(elements_len); + } + if (offset_ptype.value() != 0) { + w.writeTag(2, 0); + w.writeVarint32(offset_ptype.value()); + } + if (size_ptype.value() != 0) { + w.writeTag(3, 0); + w.writeVarint32(size_ptype.value()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Null.java b/core/src/main/java/io/github/dfa1/vortex/proto/Null.java new file mode 100644 index 00000000..40a824d8 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Null.java @@ -0,0 +1,36 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Null}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Null( +) { + + /// Decodes a {@code vortex.dtype.Null} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Null decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + default -> r.skipField(tag & 7); + } + } + return new Null(); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/NullValue.java b/core/src/main/java/io/github/dfa1/vortex/proto/NullValue.java new file mode 100644 index 00000000..90643c60 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/NullValue.java @@ -0,0 +1,34 @@ +package io.github.dfa1.vortex.proto; + +import javax.annotation.processing.Generated; + +/// Generated from proto3 enum {@code google.protobuf.NullValue}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public enum NullValue { + NULL_VALUE(0); + + private final int value; + + NullValue(int value) { + this.value = value; + } + + /// @return the wire-format integer value + public int value() { + return value; + } + + /// Resolves a wire-format integer back to its enum constant. + /// @param value wire-format integer + /// @return matching enum constant + /// @throws IllegalArgumentException if no constant matches + public static NullValue fromValue(int value) { + for (NullValue v : values()) { + if (v.value == value) { + return v; + } + } + throw new IllegalArgumentException("unknown NullValue value: " + value); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PType.java b/core/src/main/java/io/github/dfa1/vortex/proto/PType.java new file mode 100644 index 00000000..6aabc49c --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PType.java @@ -0,0 +1,44 @@ +package io.github.dfa1.vortex.proto; + +import javax.annotation.processing.Generated; + +/// Generated from proto3 enum {@code vortex.dtype.PType}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public enum PType { + U8(0), + U16(1), + U32(2), + U64(3), + I8(4), + I16(5), + I32(6), + I64(7), + F16(8), + F32(9), + F64(10); + + private final int value; + + PType(int value) { + this.value = value; + } + + /// @return the wire-format integer value + public int value() { + return value; + } + + /// Resolves a wire-format integer back to its enum constant. + /// @param value wire-format integer + /// @return matching enum constant + /// @throws IllegalArgumentException if no constant matches + public static PType fromValue(int value) { + for (PType v : values()) { + if (v.value == value) { + return v; + } + } + throw new IllegalArgumentException("unknown PType value: " + value); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PatchedMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/PatchedMetadata.java new file mode 100644 index 00000000..d5fd9d8f --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PatchedMetadata.java @@ -0,0 +1,66 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.PatchedMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param n_patches field tag 1 +/// @param n_lanes field tag 2 +/// @param offset field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record PatchedMetadata( + int n_patches, + int n_lanes, + int offset +) { + + /// Decodes a {@code vortex.encodings.PatchedMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static PatchedMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int n_patches = 0; + int n_lanes = 0; + int offset = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + n_patches = r.readVarint32(); + } + case 2 -> { + n_lanes = r.readVarint32(); + } + case 3 -> { + offset = r.readVarint32(); + } + default -> r.skipField(tag & 7); + } + } + return new PatchedMetadata(n_patches, n_lanes, offset); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (n_patches != 0) { + w.writeTag(1, 0); + w.writeVarint32(n_patches); + } + if (n_lanes != 0) { + w.writeTag(2, 0); + w.writeVarint32(n_lanes); + } + if (offset != 0) { + w.writeTag(3, 0); + w.writeVarint32(offset); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PatchesMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/PatchesMetadata.java new file mode 100644 index 00000000..9887a48e --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PatchesMetadata.java @@ -0,0 +1,106 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.PatchesMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param len field tag 1 +/// @param offset field tag 2 +/// @param indices_ptype field tag 3 +/// @param chunk_offsets_len field tag 4 +/// @param chunk_offsets_ptype field tag 5 +/// @param offset_within_chunk field tag 6 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record PatchesMetadata( + long len, + long offset, + PType indices_ptype, + Long chunk_offsets_len, + PType chunk_offsets_ptype, + Long offset_within_chunk +) { + + /// Decodes a {@code vortex.encodings.PatchesMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static PatchesMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long len = 0; + long offset = 0; + PType indices_ptype = PType.U8; + Long chunk_offsets_len = null; + PType chunk_offsets_ptype = null; + Long offset_within_chunk = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + len = r.readVarint64(); + } + case 2 -> { + offset = r.readVarint64(); + } + case 3 -> { + int __ev = r.readVarint32(); + try { + indices_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 4 -> { + chunk_offsets_len = r.readVarint64(); + } + case 5 -> { + int __ev = r.readVarint32(); + try { + chunk_offsets_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 6 -> { + offset_within_chunk = r.readVarint64(); + } + default -> r.skipField(tag & 7); + } + } + return new PatchesMetadata(len, offset, indices_ptype, chunk_offsets_len, chunk_offsets_ptype, offset_within_chunk); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (len != 0L) { + w.writeTag(1, 0); + w.writeVarint64(len); + } + if (offset != 0L) { + w.writeTag(2, 0); + w.writeVarint64(offset); + } + if (indices_ptype.value() != 0) { + w.writeTag(3, 0); + w.writeVarint32(indices_ptype.value()); + } + if (chunk_offsets_len != null) { + w.writeTag(4, 0); + w.writeVarint64(chunk_offsets_len); + } + if (chunk_offsets_ptype != null) { + w.writeTag(5, 0); + w.writeVarint32(chunk_offsets_ptype.value()); + } + if (offset_within_chunk != null) { + w.writeTag(6, 0); + w.writeVarint64(offset_within_chunk); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PcoChunkInfo.java b/core/src/main/java/io/github/dfa1/vortex/proto/PcoChunkInfo.java new file mode 100644 index 00000000..c012421d --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PcoChunkInfo.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.PcoChunkInfo}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param pages field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record PcoChunkInfo( + java.util.List pages +) { + + /// Decodes a {@code vortex.encodings.PcoChunkInfo} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static PcoChunkInfo decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + java.util.List pages = new java.util.ArrayList<>(); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + pages.add(PcoPageInfo.decode(__slice, 0, __slice.byteSize())); + } + default -> r.skipField(tag & 7); + } + } + return new PcoChunkInfo(pages); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + for (PcoPageInfo __v : pages) { + w.writeTag(1, 2); + w.writeEmbedded(__v.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PcoMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/PcoMetadata.java new file mode 100644 index 00000000..7b9f088a --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PcoMetadata.java @@ -0,0 +1,78 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import java.util.Arrays; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.PcoMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param header field tag 1 +/// @param chunks field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record PcoMetadata( + byte[] header, + java.util.List chunks +) { + + /// Decodes a {@code vortex.encodings.PcoMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static PcoMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + byte[] header = new byte[0]; + java.util.List chunks = new java.util.ArrayList<>(); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + header = r.readBytes(); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + chunks.add(PcoChunkInfo.decode(__slice, 0, __slice.byteSize())); + } + default -> r.skipField(tag & 7); + } + } + return new PcoMetadata(header, chunks); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (header != null && header.length != 0) { + w.writeTag(1, 2); + w.writeBytes(header); + } + for (PcoChunkInfo __v : chunks) { + w.writeTag(2, 2); + w.writeEmbedded(__v.encode()); + } + return w.toByteArray(); + } + + @Override + public boolean equals(Object __o) { + if (this == __o) { + return true; + } + if (!(__o instanceof PcoMetadata __that)) { + return false; + } + return java.util.Arrays.equals(header, __that.header) + && java.util.Objects.equals(chunks, __that.chunks); + } + + @Override + public int hashCode() { + int __h = 1; + __h = 31 * __h + java.util.Arrays.hashCode(header); + __h = 31 * __h + java.util.Objects.hashCode(chunks); + return __h; + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/PcoPageInfo.java b/core/src/main/java/io/github/dfa1/vortex/proto/PcoPageInfo.java new file mode 100644 index 00000000..79274ac1 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/PcoPageInfo.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.PcoPageInfo}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param n_values field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record PcoPageInfo( + int n_values +) { + + /// Decodes a {@code vortex.encodings.PcoPageInfo} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static PcoPageInfo decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int n_values = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + n_values = r.readVarint32(); + } + default -> r.skipField(tag & 7); + } + } + return new PcoPageInfo(n_values); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (n_values != 0) { + w.writeTag(1, 0); + w.writeVarint32(n_values); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Primitive.java b/core/src/main/java/io/github/dfa1/vortex/proto/Primitive.java new file mode 100644 index 00000000..e7d40e56 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Primitive.java @@ -0,0 +1,61 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Primitive}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param type field tag 1 +/// @param nullable field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Primitive( + PType type, + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Primitive} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Primitive decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType type = PType.U8; + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + type = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 2 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Primitive(type, nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (type.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(type.value()); + } + if (nullable) { + w.writeTag(2, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ProtoReader.java b/core/src/main/java/io/github/dfa1/vortex/proto/ProtoReader.java new file mode 100644 index 00000000..c2cfa88b --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ProtoReader.java @@ -0,0 +1,183 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; +import java.nio.charset.StandardCharsets; + +/// Stateful cursor over a {@link MemorySegment} that decodes proto3 wire-format primitives. +/// Generated record types call into this from their {@code decode(...)} static factories. +/// Package-private — generated code lives in the same package. +final class ProtoReader { + + private static final ValueLayout.OfByte BYTE = ValueLayout.JAVA_BYTE; + private static final ValueLayout.OfInt LE_INT = ValueLayout.JAVA_INT_UNALIGNED.withOrder(java.nio.ByteOrder.LITTLE_ENDIAN); + private static final ValueLayout.OfLong LE_LONG = ValueLayout.JAVA_LONG_UNALIGNED.withOrder(java.nio.ByteOrder.LITTLE_ENDIAN); + + private final MemorySegment seg; + private final long end; + private long pos; + + ProtoReader(MemorySegment seg, long off, long len) { + if (off < 0 || len < 0 || off + len > seg.byteSize()) { + throw new IndexOutOfBoundsException("proto reader range out of bounds: off=" + off + " len=" + len + " segSize=" + seg.byteSize()); + } + this.seg = seg; + this.pos = off; + this.end = off + len; + } + + boolean hasMore() { + return pos < end; + } + + long position() { + return pos; + } + + /// Reads an unsigned varint into an {@code int}. Up to 5 bytes. + int readVarint32() throws IOException { + long v = readVarint64(); + return (int) v; + } + + /// Reads an unsigned varint into a {@code long}. Up to 10 bytes. + long readVarint64() throws IOException { + long result = 0; + int shift = 0; + while (shift < 64) { + if (pos >= end) { + throw new IOException("truncated varint at " + pos); + } + byte b = seg.get(BYTE, pos++); + result |= ((long) (b & 0x7f)) << shift; + if ((b & 0x80) == 0) { + return result; + } + shift += 7; + } + throw new IOException("varint overflow at " + pos); + } + + /// Reads a zigzag-encoded signed varint into a {@code long}. + long readSint64() throws IOException { + long n = readVarint64(); + return (n >>> 1) ^ -(n & 1); + } + + /// Reads a little-endian 32-bit fixed value. + int readFixed32() throws IOException { + if (pos + 4 > end) { + throw new IOException("truncated fixed32 at " + pos); + } + int v = seg.get(LE_INT, pos); + pos += 4; + return v; + } + + /// Reads a little-endian 64-bit fixed value. + long readFixed64() throws IOException { + if (pos + 8 > end) { + throw new IOException("truncated fixed64 at " + pos); + } + long v = seg.get(LE_LONG, pos); + pos += 8; + return v; + } + + float readFloat() throws IOException { + return Float.intBitsToFloat(readFixed32()); + } + + double readDouble() throws IOException { + return Double.longBitsToDouble(readFixed64()); + } + + boolean readBool() throws IOException { + return readVarint64() != 0L; + } + + /// Reads a length-delimited UTF-8 string. + String readString() throws IOException { + int len = readVarint32(); + ensureBytes(len); + byte[] bytes = new byte[len]; + MemorySegment.copy(seg, BYTE, pos, bytes, 0, len); + pos += len; + return new String(bytes, StandardCharsets.UTF_8); + } + + /// Reads a length-delimited byte sequence into a fresh {@code byte[]}. + /// Use {@link #readLenDelimSegment()} for zero-copy access when the consumer can hold a segment slice. + byte[] readBytes() throws IOException { + int len = readVarint32(); + ensureBytes(len); + byte[] bytes = new byte[len]; + MemorySegment.copy(seg, BYTE, pos, bytes, 0, len); + pos += len; + return bytes; + } + + /// Returns a zero-copy slice covering the next length-delimited payload (length varint, then bytes). + /// Used by generated code to decode nested messages without allocating intermediate arrays. + MemorySegment readLenDelimSegment() throws IOException { + int len = readVarint32(); + ensureBytes(len); + MemorySegment slice = seg.asSlice(pos, len); + pos += len; + return slice; + } + + /// Skips the field whose wire type is given. Used to discard unknown fields during decode. + void skipField(int wireType) throws IOException { + switch (wireType) { + case WireType.VARINT -> { + readVarint64(); + } + case WireType.FIXED64 -> { + if (pos + 8 > end) { + throw new IOException("truncated FIXED64 skip"); + } + pos += 8; + } + case WireType.LEN -> { + int len = readVarint32(); + ensureBytes(len); + pos += len; + } + case WireType.FIXED32 -> { + if (pos + 4 > end) { + throw new IOException("truncated FIXED32 skip"); + } + pos += 4; + } + default -> throw new IOException("unsupported wire type for skip: " + wireType); + } + } + + /// Consumes a packed-repeated payload, invoking {@code consumer.accept(this)} for each element. + /// The cursor advances over each element; loop ends when the packed region is exhausted. + void readPacked(int len, PackedElementReader consumer) throws IOException { + long packedEnd = pos + len; + if (packedEnd > end) { + throw new IOException("truncated packed region"); + } + while (pos < packedEnd) { + consumer.readOne(this); + } + if (pos != packedEnd) { + throw new IOException("packed region overrun"); + } + } + + @FunctionalInterface + interface PackedElementReader { + void readOne(ProtoReader reader) throws IOException; + } + + private void ensureBytes(int len) throws IOException { + if (len < 0 || pos + len > end) { + throw new IOException("truncated len-delimited region: requested " + len + " bytes at " + pos); + } + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ProtoWriter.java b/core/src/main/java/io/github/dfa1/vortex/proto/ProtoWriter.java new file mode 100644 index 00000000..29787f93 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ProtoWriter.java @@ -0,0 +1,118 @@ +package io.github.dfa1.vortex.proto; + +import java.nio.charset.StandardCharsets; +import java.util.Arrays; + +/// Growing-buffer writer for proto3 wire-format payloads. +/// Generated record types call into this from their {@code encode()} methods. +/// Package-private — generated code lives in the same package. +final class ProtoWriter { + + private byte[] buf; + private int pos; + + ProtoWriter() { + this.buf = new byte[64]; + this.pos = 0; + } + + byte[] toByteArray() { + return Arrays.copyOf(buf, pos); + } + + void writeTag(int fieldNumber, int wireType) { + writeVarint64(WireType.tag(fieldNumber, wireType)); + } + + void writeVarint32(int value) { + writeVarint64(value & 0xffffffffL); + } + + void writeVarint64(long value) { + while ((value & ~0x7fL) != 0L) { + ensure(1); + buf[pos++] = (byte) ((value & 0x7f) | 0x80); + value >>>= 7; + } + ensure(1); + buf[pos++] = (byte) value; + } + + void writeSint64(long value) { + writeVarint64((value << 1) ^ (value >> 63)); + } + + void writeFixed32(int value) { + ensure(4); + buf[pos] = (byte) value; + buf[pos + 1] = (byte) (value >>> 8); + buf[pos + 2] = (byte) (value >>> 16); + buf[pos + 3] = (byte) (value >>> 24); + pos += 4; + } + + void writeFixed64(long value) { + ensure(8); + for (int i = 0; i < 8; i++) { + buf[pos + i] = (byte) (value >>> (i * 8)); + } + pos += 8; + } + + void writeFloat(float value) { + writeFixed32(Float.floatToRawIntBits(value)); + } + + void writeDouble(double value) { + writeFixed64(Double.doubleToRawLongBits(value)); + } + + void writeBool(boolean value) { + ensure(1); + buf[pos++] = (byte) (value ? 1 : 0); + } + + /// Writes a length-prefixed UTF-8 byte sequence. + void writeString(String value) { + byte[] bytes = value.getBytes(StandardCharsets.UTF_8); + writeVarint32(bytes.length); + writeRaw(bytes); + } + + /// Writes a length-prefixed raw byte sequence. + void writeBytes(byte[] value) { + writeVarint32(value.length); + writeRaw(value); + } + + /// Writes an already-encoded nested message as a length-prefixed block. + void writeEmbedded(byte[] encoded) { + writeVarint32(encoded.length); + writeRaw(encoded); + } + + private void writeRaw(byte[] bytes) { + ensure(bytes.length); + System.arraycopy(bytes, 0, buf, pos, bytes.length); + pos += bytes.length; + } + + private static final int MAX_CAP = Integer.MAX_VALUE - 8; + + private void ensure(int extra) { + if (extra < 0 || pos > MAX_CAP - extra) { + throw new OutOfMemoryError("proto writer would exceed " + MAX_CAP + " bytes"); + } + int needed = pos + extra; + if (needed > buf.length) { + long newCap = ((long) buf.length) << 1; + while (newCap < needed) { + newCap <<= 1; + } + if (newCap > MAX_CAP) { + newCap = MAX_CAP; + } + buf = Arrays.copyOf(buf, (int) newCap); + } + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/RLEMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/RLEMetadata.java new file mode 100644 index 00000000..875e2111 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/RLEMetadata.java @@ -0,0 +1,106 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.RLEMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param values_len field tag 1 +/// @param indices_len field tag 2 +/// @param indices_ptype field tag 3 +/// @param values_idx_offsets_len field tag 4 +/// @param values_idx_offsets_ptype field tag 5 +/// @param offset field tag 6 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record RLEMetadata( + long values_len, + long indices_len, + PType indices_ptype, + long values_idx_offsets_len, + PType values_idx_offsets_ptype, + long offset +) { + + /// Decodes a {@code vortex.encodings.RLEMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static RLEMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long values_len = 0; + long indices_len = 0; + PType indices_ptype = PType.U8; + long values_idx_offsets_len = 0; + PType values_idx_offsets_ptype = PType.U8; + long offset = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + values_len = r.readVarint64(); + } + case 2 -> { + indices_len = r.readVarint64(); + } + case 3 -> { + int __ev = r.readVarint32(); + try { + indices_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 4 -> { + values_idx_offsets_len = r.readVarint64(); + } + case 5 -> { + int __ev = r.readVarint32(); + try { + values_idx_offsets_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 6 -> { + offset = r.readVarint64(); + } + default -> r.skipField(tag & 7); + } + } + return new RLEMetadata(values_len, indices_len, indices_ptype, values_idx_offsets_len, values_idx_offsets_ptype, offset); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (values_len != 0L) { + w.writeTag(1, 0); + w.writeVarint64(values_len); + } + if (indices_len != 0L) { + w.writeTag(2, 0); + w.writeVarint64(indices_len); + } + if (indices_ptype.value() != 0) { + w.writeTag(3, 0); + w.writeVarint32(indices_ptype.value()); + } + if (values_idx_offsets_len != 0L) { + w.writeTag(4, 0); + w.writeVarint64(values_idx_offsets_len); + } + if (values_idx_offsets_ptype.value() != 0) { + w.writeTag(5, 0); + w.writeVarint32(values_idx_offsets_ptype.value()); + } + if (offset != 0L) { + w.writeTag(6, 0); + w.writeVarint64(offset); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/RunEndMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/RunEndMetadata.java new file mode 100644 index 00000000..4739222c --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/RunEndMetadata.java @@ -0,0 +1,71 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.RunEndMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param ends_ptype field tag 1 +/// @param num_runs field tag 2 +/// @param offset field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record RunEndMetadata( + PType ends_ptype, + long num_runs, + long offset +) { + + /// Decodes a {@code vortex.encodings.RunEndMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static RunEndMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType ends_ptype = PType.U8; + long num_runs = 0; + long offset = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + ends_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + case 2 -> { + num_runs = r.readVarint64(); + } + case 3 -> { + offset = r.readVarint64(); + } + default -> r.skipField(tag & 7); + } + } + return new RunEndMetadata(ends_ptype, num_runs, offset); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (ends_ptype.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(ends_ptype.value()); + } + if (num_runs != 0L) { + w.writeTag(2, 0); + w.writeVarint64(num_runs); + } + if (offset != 0L) { + w.writeTag(3, 0); + w.writeVarint64(offset); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Scalar.java b/core/src/main/java/io/github/dfa1/vortex/proto/Scalar.java new file mode 100644 index 00000000..fcbfa169 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Scalar.java @@ -0,0 +1,58 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.scalar.Scalar}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param dtype field tag 1 +/// @param value field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Scalar( + DType dtype, + ScalarValue value +) { + + /// Decodes a {@code vortex.scalar.Scalar} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Scalar decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + DType dtype = null; + ScalarValue value = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + dtype = DType.decode(__slice, 0, __slice.byteSize()); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + value = ScalarValue.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new Scalar(dtype, value); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (dtype != null) { + w.writeTag(1, 2); + w.writeEmbedded(dtype.encode()); + } + if (value != null) { + w.writeTag(2, 2); + w.writeEmbedded(value.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ScalarProtos.java b/core/src/main/java/io/github/dfa1/vortex/proto/ScalarProtos.java deleted file mode 100644 index 0fe6b565..00000000 --- a/core/src/main/java/io/github/dfa1/vortex/proto/ScalarProtos.java +++ /dev/null @@ -1,4050 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: scalar.proto -// Protobuf Java Version: 4.35.0 - -package io.github.dfa1.vortex.proto; - -@com.google.protobuf.Generated -public final class ScalarProtos extends com.google.protobuf.GeneratedFile { - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_scalar_Scalar_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_scalar_Scalar_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_scalar_ScalarValue_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_scalar_ScalarValue_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_vortex_scalar_ListValue_descriptor; - private static final - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_vortex_scalar_ListValue_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.FileDescriptor - descriptor; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ScalarProtos"); - } - - static { - java.lang.String[] descriptorData = { - "\n\014scalar.proto\022\rvortex.scalar\032\013dtype.pro" + - "to\032\034google/protobuf/struct.proto\"W\n\006Scal" + - "ar\022\"\n\005dtype\030\001 \001(\0132\023.vortex.dtype.DType\022)" + - "\n\005value\030\002 \001(\0132\032.vortex.scalar.ScalarValu" + - "e\"\332\002\n\013ScalarValue\0220\n\nnull_value\030\001 \001(\0162\032." + - "google.protobuf.NullValueH\000\022\024\n\nbool_valu" + - "e\030\002 \001(\010H\000\022\025\n\013int64_value\030\003 \001(\022H\000\022\026\n\014uint" + - "64_value\030\004 \001(\004H\000\022\023\n\tf32_value\030\005 \001(\002H\000\022\023\n" + - "\tf64_value\030\006 \001(\001H\000\022\026\n\014string_value\030\007 \001(\t" + - "H\000\022\025\n\013bytes_value\030\010 \001(\014H\000\022.\n\nlist_value\030" + - "\t \001(\0132\030.vortex.scalar.ListValueH\000\022\023\n\tf16" + - "_value\030\n \001(\004H\000\022.\n\rvariant_value\030\013 \001(\0132\025." + - "vortex.scalar.ScalarH\000B\006\n\004kind\"7\n\tListVa" + - "lue\022*\n\006values\030\001 \003(\0132\032.vortex.scalar.Scal" + - "arValueB+\n\033io.github.dfa1.vortex.protoB\014" + - "ScalarProtosb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - io.github.dfa1.vortex.proto.DTypeProtos.getDescriptor(), - com.google.protobuf.StructProto.getDescriptor(), - }); - internal_static_vortex_scalar_Scalar_descriptor = - getDescriptor().getMessageType(0); - internal_static_vortex_scalar_Scalar_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_scalar_Scalar_descriptor, - new java.lang.String[]{"Dtype", "Value",}); - internal_static_vortex_scalar_ScalarValue_descriptor = - getDescriptor().getMessageType(1); - internal_static_vortex_scalar_ScalarValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_scalar_ScalarValue_descriptor, - new java.lang.String[]{"NullValue", "BoolValue", "Int64Value", "Uint64Value", "F32Value", "F64Value", "StringValue", "BytesValue", "ListValue", "F16Value", "VariantValue", "Kind",}); - internal_static_vortex_scalar_ListValue_descriptor = - getDescriptor().getMessageType(2); - internal_static_vortex_scalar_ListValue_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_vortex_scalar_ListValue_descriptor, - new java.lang.String[]{"Values",}); - descriptor.resolveAllFeaturesImmutable(); - io.github.dfa1.vortex.proto.DTypeProtos.getDescriptor(); - com.google.protobuf.StructProto.getDescriptor(); - } - - private ScalarProtos() { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - - public interface ScalarOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.scalar.Scalar) - com.google.protobuf.MessageOrBuilder { - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return Whether the dtype field is set. - */ - boolean hasDtype(); - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return The dtype. - */ - io.github.dfa1.vortex.proto.DTypeProtos.DType getDtype(); - - /** - * .vortex.dtype.DType dtype = 1; - */ - io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypeOrBuilder(); - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return Whether the value field is set. - */ - boolean hasValue(); - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return The value. - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValue(); - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValueOrBuilder(); - } - - public interface ScalarValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.scalar.ScalarValue) - com.google.protobuf.MessageOrBuilder { - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return Whether the nullValue field is set. - */ - boolean hasNullValue(); - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The enum numeric value on the wire for nullValue. - */ - int getNullValueValue(); - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The nullValue. - */ - com.google.protobuf.NullValue getNullValue(); - - /** - * bool bool_value = 2; - * - * @return Whether the boolValue field is set. - */ - boolean hasBoolValue(); - - /** - * bool bool_value = 2; - * - * @return The boolValue. - */ - boolean getBoolValue(); - - /** - * sint64 int64_value = 3; - * - * @return Whether the int64Value field is set. - */ - boolean hasInt64Value(); - - /** - * sint64 int64_value = 3; - * - * @return The int64Value. - */ - long getInt64Value(); - - /** - * uint64 uint64_value = 4; - * - * @return Whether the uint64Value field is set. - */ - boolean hasUint64Value(); - - /** - * uint64 uint64_value = 4; - * - * @return The uint64Value. - */ - long getUint64Value(); - - /** - * float f32_value = 5; - * - * @return Whether the f32Value field is set. - */ - boolean hasF32Value(); - - /** - * float f32_value = 5; - * - * @return The f32Value. - */ - float getF32Value(); - - /** - * double f64_value = 6; - * - * @return Whether the f64Value field is set. - */ - boolean hasF64Value(); - - /** - * double f64_value = 6; - * - * @return The f64Value. - */ - double getF64Value(); - - /** - * string string_value = 7; - * - * @return Whether the stringValue field is set. - */ - boolean hasStringValue(); - - /** - * string string_value = 7; - * - * @return The stringValue. - */ - java.lang.String getStringValue(); - - /** - * string string_value = 7; - * - * @return The bytes for stringValue. - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - /** - * bytes bytes_value = 8; - * - * @return Whether the bytesValue field is set. - */ - boolean hasBytesValue(); - - /** - * bytes bytes_value = 8; - * - * @return The bytesValue. - */ - com.google.protobuf.ByteString getBytesValue(); - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return Whether the listValue field is set. - */ - boolean hasListValue(); - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return The listValue. - */ - io.github.dfa1.vortex.proto.ScalarProtos.ListValue getListValue(); - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder getListValueOrBuilder(); - - /** - * uint64 f16_value = 10; - * - * @return Whether the f16Value field is set. - */ - boolean hasF16Value(); - - /** - * uint64 f16_value = 10; - * - * @return The f16Value. - */ - long getF16Value(); - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return Whether the variantValue field is set. - */ - boolean hasVariantValue(); - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return The variantValue. - */ - io.github.dfa1.vortex.proto.ScalarProtos.Scalar getVariantValue(); - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder getVariantValueOrBuilder(); - - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.KindCase getKindCase(); - } - - public interface ListValueOrBuilder extends - // @@protoc_insertion_point(interface_extends:vortex.scalar.ListValue) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - java.util.List - getValuesList(); - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValues(int index); - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - int getValuesCount(); - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - java.util.List - getValuesOrBuilderList(); - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValuesOrBuilder( - int index); - } - - /** - * Protobuf type {@code vortex.scalar.Scalar} - */ - public static final class Scalar extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.scalar.Scalar) - ScalarOrBuilder { - public static final int DTYPE_FIELD_NUMBER = 1; - public static final int VALUE_FIELD_NUMBER = 2; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.scalar.Scalar) - private static final io.github.dfa1.vortex.proto.ScalarProtos.Scalar DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Scalar parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "Scalar"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.ScalarProtos.Scalar(); - } - - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType dtype_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value_; - private byte memoizedIsInitialized = -1; - - // Use Scalar.newBuilder() to construct. - private Scalar(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private Scalar() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_descriptor; - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.ScalarProtos.Scalar prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.Scalar getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.Scalar.class, io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder.class); - } - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return Whether the dtype field is set. - */ - @java.lang.Override - public boolean hasDtype() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return The dtype. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDtype() { - return dtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : dtype_; - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypeOrBuilder() { - return dtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : dtype_; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return Whether the value field is set. - */ - @java.lang.Override - public boolean hasValue() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return The value. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValue() { - return value_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : value_; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValueOrBuilder() { - return value_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : value_; - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getDtype()); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeMessage(2, getValue()); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getDtype()); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getValue()); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.ScalarProtos.Scalar)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.ScalarProtos.Scalar other = (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) obj; - - if (hasDtype() != other.hasDtype()) { - return false; - } - if (hasDtype()) { - if (!getDtype() - .equals(other.getDtype())) { - return false; - } - } - if (hasValue() != other.hasValue()) { - return false; - } - if (hasValue()) { - if (!getValue() - .equals(other.getValue())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasDtype()) { - hash = (37 * hash) + DTYPE_FIELD_NUMBER; - hash = (53 * hash) + getDtype().hashCode(); - } - if (hasValue()) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.scalar.Scalar} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.scalar.Scalar) - io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder { - private int bitField0_; - private io.github.dfa1.vortex.proto.DTypeProtos.DType dtype_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> dtypeBuilder_; - private io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> valueBuilder_; - - // Construct using io.github.dfa1.vortex.proto.ScalarProtos.Scalar.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.Scalar.class, io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder.class); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage - .alwaysUseFieldBuilders) { - internalGetDtypeFieldBuilder(); - internalGetValueFieldBuilder(); - } - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - dtype_ = null; - if (dtypeBuilder_ != null) { - dtypeBuilder_.dispose(); - dtypeBuilder_ = null; - } - value_ = null; - if (valueBuilder_ != null) { - valueBuilder_.dispose(); - valueBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_Scalar_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar build() { - io.github.dfa1.vortex.proto.ScalarProtos.Scalar result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar buildPartial() { - io.github.dfa1.vortex.proto.ScalarProtos.Scalar result = new io.github.dfa1.vortex.proto.ScalarProtos.Scalar(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.ScalarProtos.Scalar result) { - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.dtype_ = dtypeBuilder_ == null - ? dtype_ - : dtypeBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.value_ = valueBuilder_ == null - ? value_ - : valueBuilder_.build(); - to_bitField0_ |= 0x00000002; - } - result.bitField0_ |= to_bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.ScalarProtos.Scalar) { - return mergeFrom((io.github.dfa1.vortex.proto.ScalarProtos.Scalar) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.ScalarProtos.Scalar other) { - if (other == io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance()) { - return this; - } - if (other.hasDtype()) { - mergeDtype(other.getDtype()); - } - if (other.hasValue()) { - mergeValue(other.getValue()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage( - internalGetDtypeFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - case 18: { - input.readMessage( - internalGetValueFieldBuilder().getBuilder(), - extensionRegistry); - bitField0_ |= 0x00000002; - break; - } // case 18 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return Whether the dtype field is set. - */ - public boolean hasDtype() { - return ((bitField0_ & 0x00000001) != 0); - } - - /** - * .vortex.dtype.DType dtype = 1; - * - * @return The dtype. - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType getDtype() { - if (dtypeBuilder_ == null) { - return dtype_ == null ? io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : dtype_; - } else { - return dtypeBuilder_.getMessage(); - } - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public Builder setDtype(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (dtypeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - dtype_ = value; - } else { - dtypeBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public Builder setDtype( - io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder builderForValue) { - if (dtypeBuilder_ == null) { - dtype_ = builderForValue.build(); - } else { - dtypeBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public Builder mergeDtype(io.github.dfa1.vortex.proto.DTypeProtos.DType value) { - if (dtypeBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - dtype_ != null && - dtype_ != io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance()) { - getDtypeBuilder().mergeFrom(value); - } else { - dtype_ = value; - } - } else { - dtypeBuilder_.mergeFrom(value); - } - if (dtype_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public Builder clearDtype() { - bitField0_ = (bitField0_ & ~0x00000001); - dtype_ = null; - if (dtypeBuilder_ != null) { - dtypeBuilder_.dispose(); - dtypeBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder getDtypeBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return internalGetDtypeFieldBuilder().getBuilder(); - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - public io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder getDtypeOrBuilder() { - if (dtypeBuilder_ != null) { - return dtypeBuilder_.getMessageOrBuilder(); - } else { - return dtype_ == null ? - io.github.dfa1.vortex.proto.DTypeProtos.DType.getDefaultInstance() : dtype_; - } - } - - /** - * .vortex.dtype.DType dtype = 1; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder> - internalGetDtypeFieldBuilder() { - if (dtypeBuilder_ == null) { - dtypeBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.DTypeProtos.DType, io.github.dfa1.vortex.proto.DTypeProtos.DType.Builder, io.github.dfa1.vortex.proto.DTypeProtos.DTypeOrBuilder>( - getDtype(), - getParentForChildren(), - isClean()); - dtype_ = null; - } - return dtypeBuilder_; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return Whether the value field is set. - */ - public boolean hasValue() { - return ((bitField0_ & 0x00000002) != 0); - } - - /** - * .vortex.scalar.ScalarValue value = 2; - * - * @return The value. - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValue() { - if (valueBuilder_ == null) { - return value_ == null ? io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : value_; - } else { - return valueBuilder_.getMessage(); - } - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public Builder setValue(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (valueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - value_ = value; - } else { - valueBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public Builder setValue( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (valueBuilder_ == null) { - value_ = builderForValue.build(); - } else { - valueBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public Builder mergeValue(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (valueBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) && - value_ != null && - value_ != io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()) { - getValueBuilder().mergeFrom(value); - } else { - value_ = value; - } - } else { - valueBuilder_.mergeFrom(value); - } - if (value_ != null) { - bitField0_ |= 0x00000002; - onChanged(); - } - return this; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public Builder clearValue() { - bitField0_ = (bitField0_ & ~0x00000002); - value_ = null; - if (valueBuilder_ != null) { - valueBuilder_.dispose(); - valueBuilder_ = null; - } - onChanged(); - return this; - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder getValueBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return internalGetValueFieldBuilder().getBuilder(); - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValueOrBuilder() { - if (valueBuilder_ != null) { - return valueBuilder_.getMessageOrBuilder(); - } else { - return value_ == null ? - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance() : value_; - } - } - - /** - * .vortex.scalar.ScalarValue value = 2; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> - internalGetValueFieldBuilder() { - if (valueBuilder_ == null) { - valueBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder>( - getValue(), - getParentForChildren(), - isClean()); - value_ = null; - } - return valueBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.scalar.Scalar) - } - - } - - /** - * Protobuf type {@code vortex.scalar.ScalarValue} - */ - public static final class ScalarValue extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.scalar.ScalarValue) - ScalarValueOrBuilder { - public static final int NULL_VALUE_FIELD_NUMBER = 1; - public static final int BOOL_VALUE_FIELD_NUMBER = 2; - public static final int INT64_VALUE_FIELD_NUMBER = 3; - public static final int UINT64_VALUE_FIELD_NUMBER = 4; - public static final int F32_VALUE_FIELD_NUMBER = 5; - public static final int F64_VALUE_FIELD_NUMBER = 6; - public static final int STRING_VALUE_FIELD_NUMBER = 7; - public static final int BYTES_VALUE_FIELD_NUMBER = 8; - public static final int LIST_VALUE_FIELD_NUMBER = 9; - public static final int F16_VALUE_FIELD_NUMBER = 10; - - ; - public static final int VARIANT_VALUE_FIELD_NUMBER = 11; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.scalar.ScalarValue) - private static final io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ScalarValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ScalarValue"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue(); - } - - private int kindCase_ = 0; - @SuppressWarnings("serial") - private java.lang.Object kind_; - private byte memoizedIsInitialized = -1; - - // Use ScalarValue.newBuilder() to construct. - private ScalarValue(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ScalarValue() { - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_descriptor; - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.class, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder.class); - } - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return Whether the nullValue field is set. - */ - public boolean hasNullValue() { - return kindCase_ == 1; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The enum numeric value on the wire for nullValue. - */ - public int getNullValueValue() { - if (kindCase_ == 1) { - return (java.lang.Integer) kind_; - } - return 0; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The nullValue. - */ - public com.google.protobuf.NullValue getNullValue() { - if (kindCase_ == 1) { - com.google.protobuf.NullValue result = com.google.protobuf.NullValue.forNumber( - (java.lang.Integer) kind_); - return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result; - } - return com.google.protobuf.NullValue.NULL_VALUE; - } - - /** - * bool bool_value = 2; - * - * @return Whether the boolValue field is set. - */ - @java.lang.Override - public boolean hasBoolValue() { - return kindCase_ == 2; - } - - /** - * bool bool_value = 2; - * - * @return The boolValue. - */ - @java.lang.Override - public boolean getBoolValue() { - if (kindCase_ == 2) { - return (java.lang.Boolean) kind_; - } - return false; - } - - /** - * sint64 int64_value = 3; - * - * @return Whether the int64Value field is set. - */ - @java.lang.Override - public boolean hasInt64Value() { - return kindCase_ == 3; - } - - /** - * sint64 int64_value = 3; - * - * @return The int64Value. - */ - @java.lang.Override - public long getInt64Value() { - if (kindCase_ == 3) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - * uint64 uint64_value = 4; - * - * @return Whether the uint64Value field is set. - */ - @java.lang.Override - public boolean hasUint64Value() { - return kindCase_ == 4; - } - - /** - * uint64 uint64_value = 4; - * - * @return The uint64Value. - */ - @java.lang.Override - public long getUint64Value() { - if (kindCase_ == 4) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - * float f32_value = 5; - * - * @return Whether the f32Value field is set. - */ - @java.lang.Override - public boolean hasF32Value() { - return kindCase_ == 5; - } - - /** - * float f32_value = 5; - * - * @return The f32Value. - */ - @java.lang.Override - public float getF32Value() { - if (kindCase_ == 5) { - return (java.lang.Float) kind_; - } - return 0F; - } - - /** - * double f64_value = 6; - * - * @return Whether the f64Value field is set. - */ - @java.lang.Override - public boolean hasF64Value() { - return kindCase_ == 6; - } - - /** - * double f64_value = 6; - * - * @return The f64Value. - */ - @java.lang.Override - public double getF64Value() { - if (kindCase_ == 6) { - return (java.lang.Double) kind_; - } - return 0D; - } - - /** - * string string_value = 7; - * - * @return Whether the stringValue field is set. - */ - public boolean hasStringValue() { - return kindCase_ == 7; - } - - /** - * string string_value = 7; - * - * @return The stringValue. - */ - public java.lang.String getStringValue() { - if (kindCase_ != 7) { - return ""; - } - java.lang.Object ref = kind_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kind_ = s; - return s; - } - } - - /** - * string string_value = 7; - * - * @return The bytes for stringValue. - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - if (kindCase_ != 7) { - return com.google.protobuf.ByteString.copyFromUtf8(""); - } - java.lang.Object ref = kind_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kind_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * bytes bytes_value = 8; - * - * @return Whether the bytesValue field is set. - */ - @java.lang.Override - public boolean hasBytesValue() { - return kindCase_ == 8; - } - - /** - * bytes bytes_value = 8; - * - * @return The bytesValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString getBytesValue() { - if (kindCase_ == 8) { - return (com.google.protobuf.ByteString) kind_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return Whether the listValue field is set. - */ - @java.lang.Override - public boolean hasListValue() { - return kindCase_ == 9; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return The listValue. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue getListValue() { - if (kindCase_ == 9) { - return (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder getListValueOrBuilder() { - if (kindCase_ == 9) { - return (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - - /** - * uint64 f16_value = 10; - * - * @return Whether the f16Value field is set. - */ - @java.lang.Override - public boolean hasF16Value() { - return kindCase_ == 10; - } - - /** - * uint64 f16_value = 10; - * - * @return The f16Value. - */ - @java.lang.Override - public long getF16Value() { - if (kindCase_ == 10) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return Whether the variantValue field is set. - */ - @java.lang.Override - public boolean hasVariantValue() { - return kindCase_ == 11; - } - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return The variantValue. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar getVariantValue() { - if (kindCase_ == 11) { - return (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - - /** - *
    -         * Variant scalars carry a row-specific nested scalar.
    -         * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -         * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder getVariantValueOrBuilder() { - if (kindCase_ == 11) { - return (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (kindCase_ == 1) { - output.writeEnum(1, ((java.lang.Integer) kind_)); - } - if (kindCase_ == 2) { - output.writeBool( - 2, (boolean) ((java.lang.Boolean) kind_)); - } - if (kindCase_ == 3) { - output.writeSInt64( - 3, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 4) { - output.writeUInt64( - 4, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 5) { - output.writeFloat( - 5, (float) ((java.lang.Float) kind_)); - } - if (kindCase_ == 6) { - output.writeDouble( - 6, (double) ((java.lang.Double) kind_)); - } - if (kindCase_ == 7) { - com.google.protobuf.GeneratedMessage.writeString(output, 7, kind_); - } - if (kindCase_ == 8) { - output.writeBytes( - 8, (com.google.protobuf.ByteString) kind_); - } - if (kindCase_ == 9) { - output.writeMessage(9, (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_); - } - if (kindCase_ == 10) { - output.writeUInt64( - 10, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 11) { - output.writeMessage(11, (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - if (kindCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, ((java.lang.Integer) kind_)); - } - if (kindCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize( - 2, (boolean) ((java.lang.Boolean) kind_)); - } - if (kindCase_ == 3) { - size += com.google.protobuf.CodedOutputStream - .computeSInt64Size( - 3, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size( - 4, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 5) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize( - 5, (float) ((java.lang.Float) kind_)); - } - if (kindCase_ == 6) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize( - 6, (double) ((java.lang.Double) kind_)); - } - if (kindCase_ == 7) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(7, kind_); - } - if (kindCase_ == 8) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 8, (com.google.protobuf.ByteString) kind_); - } - if (kindCase_ == 9) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_); - } - if (kindCase_ == 10) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size( - 10, (long) ((java.lang.Long) kind_)); - } - if (kindCase_ == 11) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(11, (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_); - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue other = (io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue) obj; - - if (!getKindCase().equals(other.getKindCase())) { - return false; - } - switch (kindCase_) { - case 1: - if (getNullValueValue() - != other.getNullValueValue()) { - return false; - } - break; - case 2: - if (getBoolValue() - != other.getBoolValue()) { - return false; - } - break; - case 3: - if (getInt64Value() - != other.getInt64Value()) { - return false; - } - break; - case 4: - if (getUint64Value() - != other.getUint64Value()) { - return false; - } - break; - case 5: - if (java.lang.Float.floatToIntBits(getF32Value()) - != java.lang.Float.floatToIntBits( - other.getF32Value())) { - return false; - } - break; - case 6: - if (java.lang.Double.doubleToLongBits(getF64Value()) - != java.lang.Double.doubleToLongBits( - other.getF64Value())) { - return false; - } - break; - case 7: - if (!getStringValue() - .equals(other.getStringValue())) { - return false; - } - break; - case 8: - if (!getBytesValue() - .equals(other.getBytesValue())) { - return false; - } - break; - case 9: - if (!getListValue() - .equals(other.getListValue())) { - return false; - } - break; - case 10: - if (getF16Value() - != other.getF16Value()) { - return false; - } - break; - case 11: - if (!getVariantValue() - .equals(other.getVariantValue())) { - return false; - } - break; - case 0: - default: - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (kindCase_) { - case 1: - hash = (37 * hash) + NULL_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getNullValueValue(); - break; - case 2: - hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getBoolValue()); - break; - case 3: - hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getInt64Value()); - break; - case 4: - hash = (37 * hash) + UINT64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getUint64Value()); - break; - case 5: - hash = (37 * hash) + F32_VALUE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getF32Value()); - break; - case 6: - hash = (37 * hash) + F64_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getF64Value())); - break; - case 7: - hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStringValue().hashCode(); - break; - case 8: - hash = (37 * hash) + BYTES_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getBytesValue().hashCode(); - break; - case 9: - hash = (37 * hash) + LIST_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getListValue().hashCode(); - break; - case 10: - hash = (37 * hash) + F16_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getF16Value()); - break; - case 11: - hash = (37 * hash) + VARIANT_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getVariantValue().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - public enum KindCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - NULL_VALUE(1), - BOOL_VALUE(2), - INT64_VALUE(3), - UINT64_VALUE(4), - F32_VALUE(5), - F64_VALUE(6), - STRING_VALUE(7), - BYTES_VALUE(8), - LIST_VALUE(9), - F16_VALUE(10), - VARIANT_VALUE(11), - KIND_NOT_SET(0); - private final int value; - - private KindCase(int value) { - this.value = value; - } - - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static KindCase valueOf(int value) { - return forNumber(value); - } - - public static KindCase forNumber(int value) { - switch (value) { - case 1: - return NULL_VALUE; - case 2: - return BOOL_VALUE; - case 3: - return INT64_VALUE; - case 4: - return UINT64_VALUE; - case 5: - return F32_VALUE; - case 6: - return F64_VALUE; - case 7: - return STRING_VALUE; - case 8: - return BYTES_VALUE; - case 9: - return LIST_VALUE; - case 10: - return F16_VALUE; - case 11: - return VARIANT_VALUE; - case 0: - return KIND_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - } - - /** - * Protobuf type {@code vortex.scalar.ScalarValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.scalar.ScalarValue) - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder { - private int kindCase_ = 0; - private java.lang.Object kind_; - private int bitField0_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ListValue, io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder> listValueBuilder_; - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.Scalar, io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder> variantValueBuilder_; - - // Construct using io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.class, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (listValueBuilder_ != null) { - listValueBuilder_.clear(); - } - if (variantValueBuilder_ != null) { - variantValueBuilder_.clear(); - } - kindCase_ = 0; - kind_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ScalarValue_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue build() { - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue buildPartial() { - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue result = new io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - buildPartialOneofs(result); - onBuilt(); - return result; - } - - private void buildPartial0(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue result) { - int from_bitField0_ = bitField0_; - } - - private void buildPartialOneofs(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue result) { - result.kindCase_ = kindCase_; - result.kind_ = this.kind_; - if (kindCase_ == 9 && - listValueBuilder_ != null) { - result.kind_ = listValueBuilder_.build(); - } - if (kindCase_ == 11 && - variantValueBuilder_ != null) { - result.kind_ = variantValueBuilder_.build(); - } - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue) { - return mergeFrom((io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue other) { - if (other == io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()) { - return this; - } - switch (other.getKindCase()) { - case NULL_VALUE: { - setNullValueValue(other.getNullValueValue()); - break; - } - case BOOL_VALUE: { - setBoolValue(other.getBoolValue()); - break; - } - case INT64_VALUE: { - setInt64Value(other.getInt64Value()); - break; - } - case UINT64_VALUE: { - setUint64Value(other.getUint64Value()); - break; - } - case F32_VALUE: { - setF32Value(other.getF32Value()); - break; - } - case F64_VALUE: { - setF64Value(other.getF64Value()); - break; - } - case STRING_VALUE: { - kindCase_ = 7; - kind_ = other.kind_; - onChanged(); - break; - } - case BYTES_VALUE: { - setBytesValue(other.getBytesValue()); - break; - } - case LIST_VALUE: { - mergeListValue(other.getListValue()); - break; - } - case F16_VALUE: { - setF16Value(other.getF16Value()); - break; - } - case VARIANT_VALUE: { - mergeVariantValue(other.getVariantValue()); - break; - } - case KIND_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - kindCase_ = 1; - kind_ = rawValue; - break; - } // case 8 - case 16: { - kind_ = input.readBool(); - kindCase_ = 2; - break; - } // case 16 - case 24: { - kind_ = input.readSInt64(); - kindCase_ = 3; - break; - } // case 24 - case 32: { - kind_ = input.readUInt64(); - kindCase_ = 4; - break; - } // case 32 - case 45: { - kind_ = input.readFloat(); - kindCase_ = 5; - break; - } // case 45 - case 49: { - kind_ = input.readDouble(); - kindCase_ = 6; - break; - } // case 49 - case 58: { - kindCase_ = 7; - kind_ = input.readStringRequireUtf8(); - break; - } // case 58 - case 66: { - kind_ = input.readBytes(); - kindCase_ = 8; - break; - } // case 66 - case 74: { - input.readMessage( - internalGetListValueFieldBuilder().getBuilder(), - extensionRegistry); - kindCase_ = 9; - break; - } // case 74 - case 80: { - kind_ = input.readUInt64(); - kindCase_ = 10; - break; - } // case 80 - case 90: { - input.readMessage( - internalGetVariantValueFieldBuilder().getBuilder(), - extensionRegistry); - kindCase_ = 11; - break; - } // case 90 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - public KindCase - getKindCase() { - return KindCase.forNumber( - kindCase_); - } - - public Builder clearKind() { - kindCase_ = 0; - kind_ = null; - onChanged(); - return this; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return Whether the nullValue field is set. - */ - @java.lang.Override - public boolean hasNullValue() { - return kindCase_ == 1; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The enum numeric value on the wire for nullValue. - */ - @java.lang.Override - public int getNullValueValue() { - if (kindCase_ == 1) { - return ((java.lang.Integer) kind_).intValue(); - } - return 0; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @param value The enum numeric value on the wire for nullValue to set. - * @return This builder for chaining. - */ - public Builder setNullValueValue(int value) { - kindCase_ = 1; - kind_ = value; - onChanged(); - return this; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return The nullValue. - */ - @java.lang.Override - public com.google.protobuf.NullValue getNullValue() { - if (kindCase_ == 1) { - com.google.protobuf.NullValue result = com.google.protobuf.NullValue.forNumber( - (java.lang.Integer) kind_); - return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result; - } - return com.google.protobuf.NullValue.NULL_VALUE; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @param value The nullValue to set. - * @return This builder for chaining. - * @throws IllegalArgumentException if UNRECOGNIZED is provided. - */ - public Builder setNullValue(com.google.protobuf.NullValue value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 1; - kind_ = value.getNumber(); - onChanged(); - return this; - } - - /** - * .google.protobuf.NullValue null_value = 1; - * - * @return This builder for chaining. - */ - public Builder clearNullValue() { - if (kindCase_ == 1) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * bool bool_value = 2; - * - * @return Whether the boolValue field is set. - */ - public boolean hasBoolValue() { - return kindCase_ == 2; - } - - /** - * bool bool_value = 2; - * - * @return The boolValue. - */ - public boolean getBoolValue() { - if (kindCase_ == 2) { - return (java.lang.Boolean) kind_; - } - return false; - } - - /** - * bool bool_value = 2; - * - * @param value The boolValue to set. - * @return This builder for chaining. - */ - public Builder setBoolValue(boolean value) { - - kindCase_ = 2; - kind_ = value; - onChanged(); - return this; - } - - /** - * bool bool_value = 2; - * - * @return This builder for chaining. - */ - public Builder clearBoolValue() { - if (kindCase_ == 2) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * sint64 int64_value = 3; - * - * @return Whether the int64Value field is set. - */ - public boolean hasInt64Value() { - return kindCase_ == 3; - } - - /** - * sint64 int64_value = 3; - * - * @return The int64Value. - */ - public long getInt64Value() { - if (kindCase_ == 3) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - * sint64 int64_value = 3; - * - * @param value The int64Value to set. - * @return This builder for chaining. - */ - public Builder setInt64Value(long value) { - - kindCase_ = 3; - kind_ = value; - onChanged(); - return this; - } - - /** - * sint64 int64_value = 3; - * - * @return This builder for chaining. - */ - public Builder clearInt64Value() { - if (kindCase_ == 3) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * uint64 uint64_value = 4; - * - * @return Whether the uint64Value field is set. - */ - public boolean hasUint64Value() { - return kindCase_ == 4; - } - - /** - * uint64 uint64_value = 4; - * - * @return The uint64Value. - */ - public long getUint64Value() { - if (kindCase_ == 4) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - * uint64 uint64_value = 4; - * - * @param value The uint64Value to set. - * @return This builder for chaining. - */ - public Builder setUint64Value(long value) { - - kindCase_ = 4; - kind_ = value; - onChanged(); - return this; - } - - /** - * uint64 uint64_value = 4; - * - * @return This builder for chaining. - */ - public Builder clearUint64Value() { - if (kindCase_ == 4) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * float f32_value = 5; - * - * @return Whether the f32Value field is set. - */ - public boolean hasF32Value() { - return kindCase_ == 5; - } - - /** - * float f32_value = 5; - * - * @return The f32Value. - */ - public float getF32Value() { - if (kindCase_ == 5) { - return (java.lang.Float) kind_; - } - return 0F; - } - - /** - * float f32_value = 5; - * - * @param value The f32Value to set. - * @return This builder for chaining. - */ - public Builder setF32Value(float value) { - - kindCase_ = 5; - kind_ = value; - onChanged(); - return this; - } - - /** - * float f32_value = 5; - * - * @return This builder for chaining. - */ - public Builder clearF32Value() { - if (kindCase_ == 5) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * double f64_value = 6; - * - * @return Whether the f64Value field is set. - */ - public boolean hasF64Value() { - return kindCase_ == 6; - } - - /** - * double f64_value = 6; - * - * @return The f64Value. - */ - public double getF64Value() { - if (kindCase_ == 6) { - return (java.lang.Double) kind_; - } - return 0D; - } - - /** - * double f64_value = 6; - * - * @param value The f64Value to set. - * @return This builder for chaining. - */ - public Builder setF64Value(double value) { - - kindCase_ = 6; - kind_ = value; - onChanged(); - return this; - } - - /** - * double f64_value = 6; - * - * @return This builder for chaining. - */ - public Builder clearF64Value() { - if (kindCase_ == 6) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * string string_value = 7; - * - * @return Whether the stringValue field is set. - */ - @java.lang.Override - public boolean hasStringValue() { - return kindCase_ == 7; - } - - /** - * string string_value = 7; - * - * @return The stringValue. - */ - @java.lang.Override - public java.lang.String getStringValue() { - if (kindCase_ != 7) { - return ""; - } - java.lang.Object ref = kind_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - kind_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * string string_value = 7; - * - * @param value The stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 7; - kind_ = value; - onChanged(); - return this; - } - - /** - * string string_value = 7; - * - * @return The bytes for stringValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getStringValueBytes() { - if (kindCase_ != 7) { - return com.google.protobuf.ByteString.copyFromUtf8(""); - } - java.lang.Object ref = kind_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - kind_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string string_value = 7; - * - * @param value The bytes for stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - kindCase_ = 7; - kind_ = value; - onChanged(); - return this; - } - - /** - * string string_value = 7; - * - * @return This builder for chaining. - */ - public Builder clearStringValue() { - if (kindCase_ == 7) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * bytes bytes_value = 8; - * - * @return Whether the bytesValue field is set. - */ - public boolean hasBytesValue() { - return kindCase_ == 8; - } - - /** - * bytes bytes_value = 8; - * - * @return The bytesValue. - */ - public com.google.protobuf.ByteString getBytesValue() { - if (kindCase_ == 8) { - return (com.google.protobuf.ByteString) kind_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - /** - * bytes bytes_value = 8; - * - * @param value The bytesValue to set. - * @return This builder for chaining. - */ - public Builder setBytesValue(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - kindCase_ = 8; - kind_ = value; - onChanged(); - return this; - } - - /** - * bytes bytes_value = 8; - * - * @return This builder for chaining. - */ - public Builder clearBytesValue() { - if (kindCase_ == 8) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return Whether the listValue field is set. - */ - @java.lang.Override - public boolean hasListValue() { - return kindCase_ == 9; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - * - * @return The listValue. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue getListValue() { - if (listValueBuilder_ == null) { - if (kindCase_ == 9) { - return (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } else { - if (kindCase_ == 9) { - return listValueBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - public Builder setListValue(io.github.dfa1.vortex.proto.ScalarProtos.ListValue value) { - if (listValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - listValueBuilder_.setMessage(value); - } - kindCase_ = 9; - return this; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - public Builder setListValue( - io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder builderForValue) { - if (listValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - listValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 9; - return this; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - public Builder mergeListValue(io.github.dfa1.vortex.proto.ScalarProtos.ListValue value) { - if (listValueBuilder_ == null) { - if (kindCase_ == 9 && - kind_ != io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance()) { - kind_ = io.github.dfa1.vortex.proto.ScalarProtos.ListValue.newBuilder((io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 9) { - listValueBuilder_.mergeFrom(value); - } else { - listValueBuilder_.setMessage(value); - } - } - kindCase_ = 9; - return this; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - public Builder clearListValue() { - if (listValueBuilder_ == null) { - if (kindCase_ == 9) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 9) { - kindCase_ = 0; - kind_ = null; - } - listValueBuilder_.clear(); - } - return this; - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder getListValueBuilder() { - return internalGetListValueFieldBuilder().getBuilder(); - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder getListValueOrBuilder() { - if ((kindCase_ == 9) && (listValueBuilder_ != null)) { - return listValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 9) { - return (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - } - - /** - * .vortex.scalar.ListValue list_value = 9; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ListValue, io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder> - internalGetListValueFieldBuilder() { - if (listValueBuilder_ == null) { - if (!(kindCase_ == 9)) { - kind_ = io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - listValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ListValue, io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder>( - (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 9; - onChanged(); - return listValueBuilder_; - } - - /** - * uint64 f16_value = 10; - * - * @return Whether the f16Value field is set. - */ - public boolean hasF16Value() { - return kindCase_ == 10; - } - - /** - * uint64 f16_value = 10; - * - * @return The f16Value. - */ - public long getF16Value() { - if (kindCase_ == 10) { - return (java.lang.Long) kind_; - } - return 0L; - } - - /** - * uint64 f16_value = 10; - * - * @param value The f16Value to set. - * @return This builder for chaining. - */ - public Builder setF16Value(long value) { - - kindCase_ = 10; - kind_ = value; - onChanged(); - return this; - } - - /** - * uint64 f16_value = 10; - * - * @return This builder for chaining. - */ - public Builder clearF16Value() { - if (kindCase_ == 10) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - return this; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return Whether the variantValue field is set. - */ - @java.lang.Override - public boolean hasVariantValue() { - return kindCase_ == 11; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - * - * @return The variantValue. - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar getVariantValue() { - if (variantValueBuilder_ == null) { - if (kindCase_ == 11) { - return (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } else { - if (kindCase_ == 11) { - return variantValueBuilder_.getMessage(); - } - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - public Builder setVariantValue(io.github.dfa1.vortex.proto.ScalarProtos.Scalar value) { - if (variantValueBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - kind_ = value; - onChanged(); - } else { - variantValueBuilder_.setMessage(value); - } - kindCase_ = 11; - return this; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - public Builder setVariantValue( - io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder builderForValue) { - if (variantValueBuilder_ == null) { - kind_ = builderForValue.build(); - onChanged(); - } else { - variantValueBuilder_.setMessage(builderForValue.build()); - } - kindCase_ = 11; - return this; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - public Builder mergeVariantValue(io.github.dfa1.vortex.proto.ScalarProtos.Scalar value) { - if (variantValueBuilder_ == null) { - if (kindCase_ == 11 && - kind_ != io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance()) { - kind_ = io.github.dfa1.vortex.proto.ScalarProtos.Scalar.newBuilder((io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_) - .mergeFrom(value).buildPartial(); - } else { - kind_ = value; - } - onChanged(); - } else { - if (kindCase_ == 11) { - variantValueBuilder_.mergeFrom(value); - } else { - variantValueBuilder_.setMessage(value); - } - } - kindCase_ = 11; - return this; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - public Builder clearVariantValue() { - if (variantValueBuilder_ == null) { - if (kindCase_ == 11) { - kindCase_ = 0; - kind_ = null; - onChanged(); - } - } else { - if (kindCase_ == 11) { - kindCase_ = 0; - kind_ = null; - } - variantValueBuilder_.clear(); - } - return this; - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder getVariantValueBuilder() { - return internalGetVariantValueFieldBuilder().getBuilder(); - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder getVariantValueOrBuilder() { - if ((kindCase_ == 11) && (variantValueBuilder_ != null)) { - return variantValueBuilder_.getMessageOrBuilder(); - } else { - if (kindCase_ == 11) { - return (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_; - } - return io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - } - - /** - *
    -             * Variant scalars carry a row-specific nested scalar.
    -             * See RFC 0015: https://github.com/vortex-data/rfcs/blob/develop/accepted/0015-variant-type.md
    -             * 
    - * - * .vortex.scalar.Scalar variant_value = 11; - */ - private com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.Scalar, io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder> - internalGetVariantValueFieldBuilder() { - if (variantValueBuilder_ == null) { - if (!(kindCase_ == 11)) { - kind_ = io.github.dfa1.vortex.proto.ScalarProtos.Scalar.getDefaultInstance(); - } - variantValueBuilder_ = new com.google.protobuf.SingleFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.Scalar, io.github.dfa1.vortex.proto.ScalarProtos.Scalar.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarOrBuilder>( - (io.github.dfa1.vortex.proto.ScalarProtos.Scalar) kind_, - getParentForChildren(), - isClean()); - kind_ = null; - } - kindCase_ = 11; - onChanged(); - return variantValueBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.scalar.ScalarValue) - } - - } - - /** - * Protobuf type {@code vortex.scalar.ListValue} - */ - public static final class ListValue extends - com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:vortex.scalar.ListValue) - ListValueOrBuilder { - public static final int VALUES_FIELD_NUMBER = 1; - private static final long serialVersionUID = 0L; - // @@protoc_insertion_point(class_scope:vortex.scalar.ListValue) - private static final io.github.dfa1.vortex.proto.ScalarProtos.ListValue DEFAULT_INSTANCE; - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListValue parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( - com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 35, - /* patch= */ 0, - /* suffix= */ "", - "ListValue"); - } - - static { - DEFAULT_INSTANCE = new io.github.dfa1.vortex.proto.ScalarProtos.ListValue(); - } - - @SuppressWarnings("serial") - private java.util.List values_; - private byte memoizedIsInitialized = -1; - - // Use ListValue.newBuilder() to construct. - private ListValue(com.google.protobuf.GeneratedMessage.Builder builder) { - super(builder); - } - - private ListValue() { - values_ = java.util.Collections.emptyList(); - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_descriptor; - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessage - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(io.github.dfa1.vortex.proto.ScalarProtos.ListValue prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - public static io.github.dfa1.vortex.proto.ScalarProtos.ListValue getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.ListValue.class, io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder.class); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - @java.lang.Override - public java.util.List getValuesList() { - return values_; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - @java.lang.Override - public java.util.List - getValuesOrBuilderList() { - return values_; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - @java.lang.Override - public int getValuesCount() { - return values_.size(); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValues(int index) { - return values_.get(index); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValuesOrBuilder( - int index) { - return values_.get(index); - } - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < values_.size(); i++) { - output.writeMessage(1, values_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int computeSerializedSize_0() { - int size = 0; - - { - final int count = values_.size(); - for (int i = 0; i < count; i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSizeNoTag(values_.get(i)); - } - size += 1 * count; - } - return size; - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - size += computeSerializedSize_0(); - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof io.github.dfa1.vortex.proto.ScalarProtos.ListValue)) { - return super.equals(obj); - } - io.github.dfa1.vortex.proto.ScalarProtos.ListValue other = (io.github.dfa1.vortex.proto.ScalarProtos.ListValue) obj; - - if (!getValuesList() - .equals(other.getValuesList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - /** - * Protobuf type {@code vortex.scalar.ListValue} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:vortex.scalar.ListValue) - io.github.dfa1.vortex.proto.ScalarProtos.ListValueOrBuilder { - private int bitField0_; - private java.util.List values_ = - java.util.Collections.emptyList(); - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> valuesBuilder_; - - // Construct using io.github.dfa1.vortex.proto.ScalarProtos.ListValue.newBuilder() - private Builder() { - - } - - private Builder( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_fieldAccessorTable - .ensureFieldAccessorsInitialized( - io.github.dfa1.vortex.proto.ScalarProtos.ListValue.class, io.github.dfa1.vortex.proto.ScalarProtos.ListValue.Builder.class); - } - - @java.lang.Override - public Builder clear() { - super.clear(); - bitField0_ = 0; - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - } else { - values_ = null; - valuesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.internal_static_vortex_scalar_ListValue_descriptor; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue getDefaultInstanceForType() { - return io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance(); - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue build() { - io.github.dfa1.vortex.proto.ScalarProtos.ListValue result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public io.github.dfa1.vortex.proto.ScalarProtos.ListValue buildPartial() { - io.github.dfa1.vortex.proto.ScalarProtos.ListValue result = new io.github.dfa1.vortex.proto.ScalarProtos.ListValue(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - private void buildPartialRepeatedFields(io.github.dfa1.vortex.proto.ScalarProtos.ListValue result) { - if (valuesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.values_ = values_; - } else { - result.values_ = valuesBuilder_.build(); - } - } - - private void buildPartial0(io.github.dfa1.vortex.proto.ScalarProtos.ListValue result) { - int from_bitField0_ = bitField0_; - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof io.github.dfa1.vortex.proto.ScalarProtos.ListValue) { - return mergeFrom((io.github.dfa1.vortex.proto.ScalarProtos.ListValue) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(io.github.dfa1.vortex.proto.ScalarProtos.ListValue other) { - if (other == io.github.dfa1.vortex.proto.ScalarProtos.ListValue.getDefaultInstance()) { - return this; - } - if (valuesBuilder_ == null) { - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - } else { - if (!other.values_.isEmpty()) { - if (valuesBuilder_.isEmpty()) { - valuesBuilder_.dispose(); - valuesBuilder_ = null; - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000001); - valuesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - internalGetValuesFieldBuilder() : null; - } else { - valuesBuilder_.addAllMessages(other.values_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue m = - input.readMessage( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.parser(), - extensionRegistry); - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(m); - } else { - valuesBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - values_ = new java.util.ArrayList(values_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public java.util.List getValuesList() { - if (valuesBuilder_ == null) { - return java.util.Collections.unmodifiableList(values_); - } else { - return valuesBuilder_.getMessageList(); - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public int getValuesCount() { - if (valuesBuilder_ == null) { - return values_.size(); - } else { - return valuesBuilder_.getCount(); - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue getValues(int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessage(index); - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder setValues( - int index, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - } else { - valuesBuilder_.setMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder setValues( - int index, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.set(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder addValues(io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - } else { - valuesBuilder_.addMessage(value); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder addValues( - int index, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(index, value); - onChanged(); - } else { - valuesBuilder_.addMessage(index, value); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder addValues( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder addValues( - int index, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder addAllValues( - java.lang.Iterable values) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - } else { - valuesBuilder_.addAllMessages(values); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder clearValues() { - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - valuesBuilder_.clear(); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public Builder removeValues(int index) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.remove(index); - onChanged(); - } else { - valuesBuilder_.remove(index); - } - return this; - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder getValuesBuilder( - int index) { - return internalGetValuesFieldBuilder().getBuilder(index); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder getValuesOrBuilder( - int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessageOrBuilder(index); - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public java.util.List - getValuesOrBuilderList() { - if (valuesBuilder_ != null) { - return valuesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(values_); - } - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder addValuesBuilder() { - return internalGetValuesFieldBuilder().addBuilder( - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder addValuesBuilder( - int index) { - return internalGetValuesFieldBuilder().addBuilder( - index, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.getDefaultInstance()); - } - - /** - * repeated .vortex.scalar.ScalarValue values = 1; - */ - public java.util.List - getValuesBuilderList() { - return internalGetValuesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder> - internalGetValuesFieldBuilder() { - if (valuesBuilder_ == null) { - valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValue.Builder, io.github.dfa1.vortex.proto.ScalarProtos.ScalarValueOrBuilder>( - values_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - values_ = null; - } - return valuesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:vortex.scalar.ListValue) - } - - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ScalarValue.java b/core/src/main/java/io/github/dfa1/vortex/proto/ScalarValue.java new file mode 100644 index 00000000..060fff6d --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ScalarValue.java @@ -0,0 +1,269 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import java.util.Arrays; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.scalar.ScalarValue}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param null_value field tag 1 +/// @param bool_value field tag 2 +/// @param int64_value field tag 3 +/// @param uint64_value field tag 4 +/// @param f32_value field tag 5 +/// @param f64_value field tag 6 +/// @param string_value field tag 7 +/// @param bytes_value field tag 8 +/// @param list_value field tag 9 +/// @param f16_value field tag 10 +/// @param variant_value field tag 11 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ScalarValue( + NullValue null_value, + Boolean bool_value, + Long int64_value, + Long uint64_value, + Float f32_value, + Double f64_value, + String string_value, + byte[] bytes_value, + ListValue list_value, + Long f16_value, + Scalar variant_value +) { + + /// Decodes a {@code vortex.scalar.ScalarValue} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ScalarValue decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + NullValue null_value = null; + Boolean bool_value = null; + Long int64_value = null; + Long uint64_value = null; + Float f32_value = null; + Double f64_value = null; + String string_value = null; + byte[] bytes_value = null; + ListValue list_value = null; + Long f16_value = null; + Scalar variant_value = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + null_value = NullValue.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown NullValue value: " + __ev); + } + } + case 2 -> { + bool_value = r.readBool(); + } + case 3 -> { + int64_value = r.readSint64(); + } + case 4 -> { + uint64_value = r.readVarint64(); + } + case 5 -> { + f32_value = r.readFloat(); + } + case 6 -> { + f64_value = r.readDouble(); + } + case 7 -> { + string_value = r.readString(); + } + case 8 -> { + bytes_value = r.readBytes(); + } + case 9 -> { + MemorySegment __slice = r.readLenDelimSegment(); + list_value = ListValue.decode(__slice, 0, __slice.byteSize()); + } + case 10 -> { + f16_value = r.readVarint64(); + } + case 11 -> { + MemorySegment __slice = r.readLenDelimSegment(); + variant_value = Scalar.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new ScalarValue(null_value, bool_value, int64_value, uint64_value, f32_value, f64_value, string_value, bytes_value, list_value, f16_value, variant_value); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (null_value != null) { + w.writeTag(1, 0); + w.writeVarint32(null_value.value()); + } + if (bool_value != null) { + w.writeTag(2, 0); + w.writeBool(bool_value); + } + if (int64_value != null) { + w.writeTag(3, 0); + w.writeSint64(int64_value); + } + if (uint64_value != null) { + w.writeTag(4, 0); + w.writeVarint64(uint64_value); + } + if (f32_value != null) { + w.writeTag(5, 5); + w.writeFloat(f32_value); + } + if (f64_value != null) { + w.writeTag(6, 1); + w.writeDouble(f64_value); + } + if (string_value != null) { + w.writeTag(7, 2); + w.writeString(string_value); + } + if (bytes_value != null) { + w.writeTag(8, 2); + w.writeBytes(bytes_value); + } + if (list_value != null) { + w.writeTag(9, 2); + w.writeEmbedded(list_value.encode()); + } + if (f16_value != null) { + w.writeTag(10, 0); + w.writeVarint64(f16_value); + } + if (variant_value != null) { + w.writeTag(11, 2); + w.writeEmbedded(variant_value.encode()); + } + return w.toByteArray(); + } + + /// Factory for oneof case {@code null_value} (field tag 1). + /// @param value the value to set + /// @return a record with only the {@code null_value} component set + public static ScalarValue ofNullValue(NullValue value) { + return new ScalarValue(value, null, null, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code bool_value} (field tag 2). + /// @param value the value to set + /// @return a record with only the {@code bool_value} component set + public static ScalarValue ofBoolValue(Boolean value) { + return new ScalarValue(null, value, null, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code int64_value} (field tag 3). + /// @param value the value to set + /// @return a record with only the {@code int64_value} component set + public static ScalarValue ofInt64Value(Long value) { + return new ScalarValue(null, null, value, null, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code uint64_value} (field tag 4). + /// @param value the value to set + /// @return a record with only the {@code uint64_value} component set + public static ScalarValue ofUint64Value(Long value) { + return new ScalarValue(null, null, null, value, null, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code f32_value} (field tag 5). + /// @param value the value to set + /// @return a record with only the {@code f32_value} component set + public static ScalarValue ofF32Value(Float value) { + return new ScalarValue(null, null, null, null, value, null, null, null, null, null, null); + } + + /// Factory for oneof case {@code f64_value} (field tag 6). + /// @param value the value to set + /// @return a record with only the {@code f64_value} component set + public static ScalarValue ofF64Value(Double value) { + return new ScalarValue(null, null, null, null, null, value, null, null, null, null, null); + } + + /// Factory for oneof case {@code string_value} (field tag 7). + /// @param value the value to set + /// @return a record with only the {@code string_value} component set + public static ScalarValue ofStringValue(String value) { + return new ScalarValue(null, null, null, null, null, null, value, null, null, null, null); + } + + /// Factory for oneof case {@code bytes_value} (field tag 8). + /// @param value the value to set + /// @return a record with only the {@code bytes_value} component set + public static ScalarValue ofBytesValue(byte[] value) { + return new ScalarValue(null, null, null, null, null, null, null, value, null, null, null); + } + + /// Factory for oneof case {@code list_value} (field tag 9). + /// @param value the value to set + /// @return a record with only the {@code list_value} component set + public static ScalarValue ofListValue(ListValue value) { + return new ScalarValue(null, null, null, null, null, null, null, null, value, null, null); + } + + /// Factory for oneof case {@code f16_value} (field tag 10). + /// @param value the value to set + /// @return a record with only the {@code f16_value} component set + public static ScalarValue ofF16Value(Long value) { + return new ScalarValue(null, null, null, null, null, null, null, null, null, value, null); + } + + /// Factory for oneof case {@code variant_value} (field tag 11). + /// @param value the value to set + /// @return a record with only the {@code variant_value} component set + public static ScalarValue ofVariantValue(Scalar value) { + return new ScalarValue(null, null, null, null, null, null, null, null, null, null, value); + } + + @Override + public boolean equals(Object __o) { + if (this == __o) { + return true; + } + if (!(__o instanceof ScalarValue __that)) { + return false; + } + return java.util.Objects.equals(null_value, __that.null_value) + && java.util.Objects.equals(bool_value, __that.bool_value) + && java.util.Objects.equals(int64_value, __that.int64_value) + && java.util.Objects.equals(uint64_value, __that.uint64_value) + && java.util.Objects.equals(f32_value, __that.f32_value) + && java.util.Objects.equals(f64_value, __that.f64_value) + && java.util.Objects.equals(string_value, __that.string_value) + && java.util.Arrays.equals(bytes_value, __that.bytes_value) + && java.util.Objects.equals(list_value, __that.list_value) + && java.util.Objects.equals(f16_value, __that.f16_value) + && java.util.Objects.equals(variant_value, __that.variant_value); + } + + @Override + public int hashCode() { + int __h = 1; + __h = 31 * __h + java.util.Objects.hashCode(null_value); + __h = 31 * __h + java.util.Objects.hashCode(bool_value); + __h = 31 * __h + java.util.Objects.hashCode(int64_value); + __h = 31 * __h + java.util.Objects.hashCode(uint64_value); + __h = 31 * __h + java.util.Objects.hashCode(f32_value); + __h = 31 * __h + java.util.Objects.hashCode(f64_value); + __h = 31 * __h + java.util.Objects.hashCode(string_value); + __h = 31 * __h + java.util.Arrays.hashCode(bytes_value); + __h = 31 * __h + java.util.Objects.hashCode(list_value); + __h = 31 * __h + java.util.Objects.hashCode(f16_value); + __h = 31 * __h + java.util.Objects.hashCode(variant_value); + return __h; + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/SequenceMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/SequenceMetadata.java new file mode 100644 index 00000000..80886c0a --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/SequenceMetadata.java @@ -0,0 +1,58 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.SequenceMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param base field tag 1 +/// @param multiplier field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record SequenceMetadata( + ScalarValue base, + ScalarValue multiplier +) { + + /// Decodes a {@code vortex.encodings.SequenceMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static SequenceMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + ScalarValue base = null; + ScalarValue multiplier = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + base = ScalarValue.decode(__slice, 0, __slice.byteSize()); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + multiplier = ScalarValue.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new SequenceMetadata(base, multiplier); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (base != null) { + w.writeTag(1, 2); + w.writeEmbedded(base.encode()); + } + if (multiplier != null) { + w.writeTag(2, 2); + w.writeEmbedded(multiplier.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/SparseMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/SparseMetadata.java new file mode 100644 index 00000000..73f2fe37 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/SparseMetadata.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.SparseMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param patches field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record SparseMetadata( + PatchesMetadata patches +) { + + /// Decodes a {@code vortex.encodings.SparseMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static SparseMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PatchesMetadata patches = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + patches = PatchesMetadata.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new SparseMetadata(patches); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (patches != null) { + w.writeTag(1, 2); + w.writeEmbedded(patches.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Struct.java b/core/src/main/java/io/github/dfa1/vortex/proto/Struct.java new file mode 100644 index 00000000..98b38edc --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Struct.java @@ -0,0 +1,67 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Struct}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param names field tag 1 +/// @param dtypes field tag 2 +/// @param nullable field tag 3 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Struct( + java.util.List names, + java.util.List dtypes, + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Struct} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Struct decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + java.util.List names = new java.util.ArrayList<>(); + java.util.List dtypes = new java.util.ArrayList<>(); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + names.add(r.readString()); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + dtypes.add(DType.decode(__slice, 0, __slice.byteSize())); + } + case 3 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Struct(names, dtypes, nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + for (String __v : names) { + w.writeTag(1, 2); + w.writeString(__v); + } + for (DType __v : dtypes) { + w.writeTag(2, 2); + w.writeEmbedded(__v.encode()); + } + if (nullable) { + w.writeTag(3, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Union.java b/core/src/main/java/io/github/dfa1/vortex/proto/Union.java new file mode 100644 index 00000000..97985ec6 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Union.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Union}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param nullable field tag 4 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Union( + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Union} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Union decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 4 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Union(nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (nullable) { + w.writeTag(4, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Utf8.java b/core/src/main/java/io/github/dfa1/vortex/proto/Utf8.java new file mode 100644 index 00000000..025f5f4f --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Utf8.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Utf8}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param nullable field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Utf8( + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Utf8} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Utf8 decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Utf8(nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (nullable) { + w.writeTag(1, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/VarBinMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/VarBinMetadata.java new file mode 100644 index 00000000..7206c672 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/VarBinMetadata.java @@ -0,0 +1,51 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.VarBinMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param offsets_ptype field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record VarBinMetadata( + PType offsets_ptype +) { + + /// Decodes a {@code vortex.encodings.VarBinMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static VarBinMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + PType offsets_ptype = PType.U8; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + int __ev = r.readVarint32(); + try { + offsets_ptype = PType.fromValue(__ev); + } catch (IllegalArgumentException __iae) { + throw new IOException("unknown PType value: " + __ev); + } + } + default -> r.skipField(tag & 7); + } + } + return new VarBinMetadata(offsets_ptype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (offsets_ptype.value() != 0) { + w.writeTag(1, 0); + w.writeVarint32(offsets_ptype.value()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/Variant.java b/core/src/main/java/io/github/dfa1/vortex/proto/Variant.java new file mode 100644 index 00000000..a5c2f710 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/Variant.java @@ -0,0 +1,46 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.dtype.Variant}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param nullable field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record Variant( + boolean nullable +) { + + /// Decodes a {@code vortex.dtype.Variant} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static Variant decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + boolean nullable = false; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + nullable = r.readBool(); + } + default -> r.skipField(tag & 7); + } + } + return new Variant(nullable); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (nullable) { + w.writeTag(1, 0); + w.writeBool(nullable); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/VariantMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/VariantMetadata.java new file mode 100644 index 00000000..a84f220b --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/VariantMetadata.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.VariantMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param shredded_dtype field tag 1 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record VariantMetadata( + DType shredded_dtype +) { + + /// Decodes a {@code vortex.encodings.VariantMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static VariantMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + DType shredded_dtype = null; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + MemorySegment __slice = r.readLenDelimSegment(); + shredded_dtype = DType.decode(__slice, 0, __slice.byteSize()); + } + default -> r.skipField(tag & 7); + } + } + return new VariantMetadata(shredded_dtype); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (shredded_dtype != null) { + w.writeTag(1, 2); + w.writeEmbedded(shredded_dtype.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/WireType.java b/core/src/main/java/io/github/dfa1/vortex/proto/WireType.java new file mode 100644 index 00000000..c404efb2 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/WireType.java @@ -0,0 +1,18 @@ +package io.github.dfa1.vortex.proto; + +/// Proto3 wire-type constants. +/// Each field on the wire is preceded by a tag varint encoding {@code (fieldNumber << 3) | wireType}. +final class WireType { + + static final int VARINT = 0; + static final int FIXED64 = 1; + static final int LEN = 2; + static final int FIXED32 = 5; + + private WireType() { + } + + static int tag(int fieldNumber, int wireType) { + return (fieldNumber << 3) | wireType; + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ZstdFrameMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ZstdFrameMetadata.java new file mode 100644 index 00000000..45120fdc --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ZstdFrameMetadata.java @@ -0,0 +1,56 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ZstdFrameMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param uncompressed_size field tag 1 +/// @param n_values field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ZstdFrameMetadata( + long uncompressed_size, + long n_values +) { + + /// Decodes a {@code vortex.encodings.ZstdFrameMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ZstdFrameMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + long uncompressed_size = 0; + long n_values = 0; + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + uncompressed_size = r.readVarint64(); + } + case 2 -> { + n_values = r.readVarint64(); + } + default -> r.skipField(tag & 7); + } + } + return new ZstdFrameMetadata(uncompressed_size, n_values); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (uncompressed_size != 0L) { + w.writeTag(1, 0); + w.writeVarint64(uncompressed_size); + } + if (n_values != 0L) { + w.writeTag(2, 0); + w.writeVarint64(n_values); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/java/io/github/dfa1/vortex/proto/ZstdMetadata.java b/core/src/main/java/io/github/dfa1/vortex/proto/ZstdMetadata.java new file mode 100644 index 00000000..4c1c81a4 --- /dev/null +++ b/core/src/main/java/io/github/dfa1/vortex/proto/ZstdMetadata.java @@ -0,0 +1,57 @@ +package io.github.dfa1.vortex.proto; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; +import javax.annotation.processing.Generated; + +/// Generated from proto3 message {@code vortex.encodings.ZstdMetadata}. +/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}. +/// @param dictionary_size field tag 1 +/// @param frames field tag 2 +@Generated("io.github.dfa1.vortex.protogen.CodeGen") +public record ZstdMetadata( + int dictionary_size, + java.util.List frames +) { + + /// Decodes a {@code vortex.encodings.ZstdMetadata} from a slice of a memory segment. + /// @param __seg backing segment + /// @param __off start offset in bytes + /// @param __len payload length in bytes + /// @return decoded record + /// @throws IOException if the slice is malformed or truncated + public static ZstdMetadata decode(MemorySegment __seg, long __off, long __len) throws IOException { + ProtoReader r = new ProtoReader(__seg, __off, __len); + int dictionary_size = 0; + java.util.List frames = new java.util.ArrayList<>(); + while (r.hasMore()) { + int tag = r.readVarint32(); + switch (tag >>> 3) { + case 1 -> { + dictionary_size = r.readVarint32(); + } + case 2 -> { + MemorySegment __slice = r.readLenDelimSegment(); + frames.add(ZstdFrameMetadata.decode(__slice, 0, __slice.byteSize())); + } + default -> r.skipField(tag & 7); + } + } + return new ZstdMetadata(dictionary_size, frames); + } + + /// Encodes this record to a proto3-wire-format byte array. + /// @return encoded bytes + public byte[] encode() { + ProtoWriter w = new ProtoWriter(); + if (dictionary_size != 0) { + w.writeTag(1, 0); + w.writeVarint32(dictionary_size); + } + for (ZstdFrameMetadata __v : frames) { + w.writeTag(2, 2); + w.writeEmbedded(__v.encode()); + } + return w.toByteArray(); + } +} diff --git a/core/src/main/proto/encodings.proto b/core/src/main/proto/encodings.proto index cd5f2c3d..0c1fa98c 100644 --- a/core/src/main/proto/encodings.proto +++ b/core/src/main/proto/encodings.proto @@ -132,3 +132,13 @@ message PcoMetadata { bytes header = 1; repeated PcoChunkInfo chunks = 2; } + +message PatchedMetadata { + uint32 n_patches = 1; + uint32 n_lanes = 2; + uint32 offset = 3; +} + +message VariantMetadata { + optional vortex.dtype.DType shredded_dtype = 1; +} diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/AlpEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/AlpEncodingTest.java index dcb03f20..5878e433 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/AlpEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/AlpEncodingTest.java @@ -3,7 +3,8 @@ import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.ALPMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -28,19 +29,14 @@ private static DecodeContext buildAlpCtxF64( long[] patchIndices, double[] patchValues ) { - EncodingProtos.ALPMetadata.Builder metaBuilder = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(expE).setExpF(expF); - - if (patchIndices != null) { - EncodingProtos.PatchesMetadata pm = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(patchIndices.length) - .setOffset(0) - .setIndicesPtype(io.github.dfa1.vortex.proto.DTypeProtos.PType.U32) - .build(); - metaBuilder.setPatches(pm); - } - - byte[] metaBytes = metaBuilder.build().toByteArray(); + PatchesMetadata pm = patchIndices != null + ? new PatchesMetadata( + (long) patchIndices.length, + 0L, + io.github.dfa1.vortex.proto.PType.U32, + null, null, null) + : null; + byte[] metaBytes = new ALPMetadata(expE, expF, pm).encode(); byte[] encBuf = new byte[encodedVals.length * 8]; ByteBuffer bb = ByteBuffer.wrap(encBuf).order(ByteOrder.LITTLE_ENDIAN); @@ -95,10 +91,7 @@ private static DecodeContext buildAlpCtxF32( int expE, int expF, int[] encodedVals ) { - EncodingProtos.ALPMetadata.Builder metaBuilder = EncodingProtos.ALPMetadata.newBuilder() - .setExpE(expE).setExpF(expF); - - byte[] metaBytes = metaBuilder.build().toByteArray(); + byte[] metaBytes = new ALPMetadata(expE, expF, null).encode(); byte[] encBuf = new byte[encodedVals.length * 4]; ByteBuffer bb = ByteBuffer.wrap(encBuf).order(ByteOrder.LITTLE_ENDIAN); @@ -289,11 +282,11 @@ void encode_f64_metadata_expE_isNonZero() throws Exception { // When EncodeResult result = sut.encode(DTypes.F64, values, EncodeTestHelper.testCtx()); - EncodingProtos.ALPMetadata meta = - EncodingProtos.ALPMetadata.parseFrom(result.rootNode().metadata().duplicate()); + MemorySegment metaSeg = MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()); + ALPMetadata meta = ALPMetadata.decode(metaSeg, 0, metaSeg.byteSize()); // Then - assertThat(meta.getExpE()).isGreaterThan(0); + assertThat(meta.exp_e()).isGreaterThan(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/AlpRdEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/AlpRdEncodingTest.java index e5ffc8dc..b3b05583 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/AlpRdEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/AlpRdEncodingTest.java @@ -1,7 +1,7 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.ALPRDMetadata; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -42,11 +42,11 @@ void encode_f64_metadata_rightBitWidth_isNonZero() throws Exception { // When EncodeResult result = sut.encode(DTypes.F64, values, EncodeTestHelper.testCtx()); - EncodingProtos.ALPRDMetadata meta = - EncodingProtos.ALPRDMetadata.parseFrom(result.rootNode().metadata().duplicate()); + ALPRDMetadata meta = + ALPRDMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getRightBitWidth()).isGreaterThan(0); + assertThat(meta.right_bit_width()).isGreaterThan(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingPatchesTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingPatchesTest.java index 86723b32..0ab812af 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingPatchesTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingPatchesTest.java @@ -1,10 +1,10 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.BitPackedMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -32,17 +32,9 @@ void decode_appliesPatches_overridingBitPackedValues() { byte[] packedBytes = packedSeg.toArray(java.lang.foreign.ValueLayout.JAVA_BYTE); // Build new BitPackedMetadata that re-uses the packed bytes but advertises patches. - EncodingProtos.PatchesMetadata patches = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(2) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.U32) - .build(); - byte[] metaBytes = EncodingProtos.BitPackedMetadata.newBuilder() - .setBitWidth(6) // matches encoder's choice for max=50 - .setOffset(0) - .setPatches(patches) - .build() - .toByteArray(); + PatchesMetadata patches = new PatchesMetadata(2L, 0L, + io.github.dfa1.vortex.proto.PType.U32, null, null, null); + byte[] metaBytes = new BitPackedMetadata(6, 0, patches).encode(); byte[] idxBuf = new byte[2 * 4]; ByteBuffer.wrap(idxBuf).order(ByteOrder.LITTLE_ENDIAN).putInt(1).putInt(3); diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingTest.java index bfcf9bce..fdda5e90 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/BitpackedEncodingTest.java @@ -1,8 +1,8 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.BitPackedMetadata; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -88,11 +88,11 @@ void encode_i32_metadata_bitWidth_isNonZero() throws Exception { // When EncodeResult result = sut.encode(DTypes.I32, data, EncodeTestHelper.testCtx()); - EncodingProtos.BitPackedMetadata meta = - EncodingProtos.BitPackedMetadata.parseFrom(result.rootNode().metadata().duplicate()); + BitPackedMetadata meta = + BitPackedMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getBitWidth()).isGreaterThan(0); + assertThat(meta.bit_width()).isGreaterThan(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/DateTimePartsEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/DateTimePartsEncodingTest.java index d3c54bc3..68e8851b 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/DateTimePartsEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/DateTimePartsEncodingTest.java @@ -1,11 +1,11 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.DateTimePartsMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.array.GenericArray; import io.github.dfa1.vortex.core.array.LongArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -241,13 +241,13 @@ void encode_metadata_ptypes_areI64() throws Exception { // When EncodeResult result = sut.encode(EXT_TIMESTAMP_MS, data, EncodeTestHelper.testCtx()); - EncodingProtos.DateTimePartsMetadata meta = - EncodingProtos.DateTimePartsMetadata.parseFrom(result.rootNode().metadata().duplicate()); + DateTimePartsMetadata meta = + DateTimePartsMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getDaysPtypeValue()).isEqualTo(7); // I64 - assertThat(meta.getSecondsPtypeValue()).isEqualTo(7); // I64 - assertThat(meta.getSubsecondsPtypeValue()).isEqualTo(7); // I64 + assertThat(meta.days_ptype().value()).isEqualTo(7); // I64 + assertThat(meta.seconds_ptype().value()).isEqualTo(7); // I64 + assertThat(meta.subseconds_ptype().value()).isEqualTo(7); // I64 } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncodingTest.java index 03a89601..d221ceb5 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalBytePartsEncodingTest.java @@ -1,10 +1,10 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.DecimalBytePartsMetadata; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; import io.github.dfa1.vortex.core.array.GenericArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -68,10 +68,10 @@ void metadata_zerothChildPtype_isI64_lowerPartCountIsZero() throws Exception { // Then byte[] metaBytes = new byte[result.rootNode().metadata().remaining()]; result.rootNode().metadata().duplicate().get(metaBytes); - EncodingProtos.DecimalBytePartsMetadata meta = - EncodingProtos.DecimalBytePartsMetadata.parseFrom(metaBytes); - assertThat(meta.getZerothChildPtypeValue()).isEqualTo(7); // I64 ordinal - assertThat(meta.getLowerPartCount()).isEqualTo(0); + DecimalBytePartsMetadata meta = + DecimalBytePartsMetadata.decode(java.lang.foreign.MemorySegment.ofArray(metaBytes), 0, metaBytes.length); + assertThat(meta.zeroth_child_ptype().value()).isEqualTo(7); // I64 ordinal + assertThat(meta.lower_part_count()).isEqualTo(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalEncodingTest.java index a20e4edf..63059cd0 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/DecimalEncodingTest.java @@ -1,11 +1,11 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.DecimalMetadata; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -87,8 +87,8 @@ void valuesType_matchesPrecisionBoundaries(int precision, int expectedValuesType // Then byte[] metaBytes = new byte[encoded.rootNode().metadata().remaining()]; encoded.rootNode().metadata().duplicate().get(metaBytes); - EncodingProtos.DecimalMetadata meta = EncodingProtos.DecimalMetadata.parseFrom(metaBytes); - assertThat(meta.getValuesType()).isEqualTo(expectedValuesType); + DecimalMetadata meta = DecimalMetadata.decode(java.lang.foreign.MemorySegment.ofArray(metaBytes), 0, metaBytes.length); + assertThat(meta.values_type()).isEqualTo(expectedValuesType); } @Test diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/DeltaEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/DeltaEncodingTest.java index ac90a601..4a7cd530 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/DeltaEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/DeltaEncodingTest.java @@ -2,7 +2,9 @@ import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.EncodingProtos; +import io.github.dfa1.vortex.proto.DeltaMetadata; + +import java.lang.foreign.MemorySegment; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -117,11 +119,11 @@ void encode_i64_metadata_deltasLen_isNonZero() throws Exception { // When EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); - EncodingProtos.DeltaMetadata meta = - EncodingProtos.DeltaMetadata.parseFrom(result.rootNode().metadata().duplicate()); + MemorySegment metaSeg = MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()); + DeltaMetadata meta = DeltaMetadata.decode(metaSeg, 0, metaSeg.byteSize()); // Then - assertThat(meta.getDeltasLen()).isGreaterThan(0); + assertThat(meta.deltas_len()).isGreaterThan(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/DictEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/DictEncodingTest.java index cfeb0e15..df1bd16b 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/DictEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/DictEncodingTest.java @@ -1,9 +1,9 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.DictMetadata; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -185,11 +185,11 @@ void encode_utf8_metadata_valuesLen_matchesUniqueCount() throws Exception { // When EncodeResult result = sut.encode(DTypes.UTF8, data, EncodeTestHelper.testCtx()); - EncodingProtos.DictMetadata meta = - EncodingProtos.DictMetadata.parseFrom(result.rootNode().metadata().duplicate()); + DictMetadata meta = + DictMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getValuesLen()).isEqualTo(2); + assertThat(meta.values_len()).isEqualTo(2); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncodingTest.java index 8b620976..6ea12e5e 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/FrameOfReferenceEncodingTest.java @@ -6,7 +6,7 @@ import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; import io.github.dfa1.vortex.core.array.MaskedArray; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -29,10 +29,7 @@ class Decode { private static DecodeContext buildForContext( DType dtype, long reference, long[] residuals, PType ptype ) { - byte[] metaBytes = ScalarProtos.ScalarValue.newBuilder() - .setInt64Value(reference) - .build() - .toByteArray(); + byte[] metaBytes = ScalarValue.ofInt64Value(reference).encode(); int elemBytes = ptype.byteSize(); byte[] childBytes = new byte[residuals.length * elemBytes]; @@ -166,7 +163,7 @@ void decode_nullableResiduals_returnsMaskedArrayWithCorrectValues() { EncodingId.VORTEX_BOOL, null, new ArrayNode[0], new int[]{1}, ArrayStats.empty()); ArrayNode primNode = ArrayNode.of( EncodingId.VORTEX_PRIMITIVE, null, new ArrayNode[]{validityNode}, new int[]{0}, ArrayStats.empty()); - byte[] metaBytes = ScalarProtos.ScalarValue.newBuilder().setInt64Value(reference).build().toByteArray(); + byte[] metaBytes = ScalarValue.ofInt64Value(reference).encode(); ArrayNode forNode = ArrayNode.of( EncodingId.FASTLANES_FOR, ByteBuffer.wrap(metaBytes), new ArrayNode[]{primNode}, new int[0], ArrayStats.empty()); diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/FsstEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/FsstEncodingTest.java index c4d47d2a..cdd8eb20 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/FsstEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/FsstEncodingTest.java @@ -1,10 +1,9 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.FSSTMetadata; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -149,10 +148,7 @@ private static DecodeContext buildCtx( MemorySegment[] segs = {symBuf, symLenBuf, compBuf, uncompLenBuf, codesOffBuf}; - byte[] metaBytes = EncodingProtos.FSSTMetadata.newBuilder() - .setUncompressedLengthsPtype(DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .setCodesOffsetsPtype(DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .build().toByteArray(); + byte[] metaBytes = new FSSTMetadata(io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal()), io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal())).encode(); ArrayNode uncompLensNode = ArrayNode.of( EncodingId.VORTEX_PRIMITIVE, null, new ArrayNode[0], new int[]{3}, null); @@ -290,12 +286,12 @@ void encode_metadata_ptypes_areI32() throws Exception { // When EncodeResult result = sut.encode(DTypes.UTF8, data, EncodeTestHelper.testCtx()); - EncodingProtos.FSSTMetadata meta = - EncodingProtos.FSSTMetadata.parseFrom(result.rootNode().metadata().duplicate()); + FSSTMetadata meta = + FSSTMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getUncompressedLengthsPtypeValue()).isEqualTo(6); // I32 - assertThat(meta.getCodesOffsetsPtypeValue()).isEqualTo(6); // I32 + assertThat(meta.uncompressed_lengths_ptype().value()).isEqualTo(6); // I32 + assertThat(meta.codes_offsets_ptype().value()).isEqualTo(6); // I32 } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/ListEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/ListEncodingTest.java index deb1c437..975b556b 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/ListEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/ListEncodingTest.java @@ -1,10 +1,10 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.ListMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.ListArray; import io.github.dfa1.vortex.core.array.LongArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -192,11 +192,11 @@ void encode_metadata_elementsLen_matchesElementCount() throws Exception { // When EncodeResult result = sut.encode(DTypes.LIST_I32, data, EncodeTestHelper.testCtx()); - EncodingProtos.ListMetadata meta = - EncodingProtos.ListMetadata.parseFrom(result.rootNode().metadata().duplicate()); + ListMetadata meta = + ListMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getElementsLen()).isEqualTo(5); + assertThat(meta.elements_len()).isEqualTo(5); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/ListViewEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/ListViewEncodingTest.java index a95156e2..539ccfa5 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/ListViewEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/ListViewEncodingTest.java @@ -1,9 +1,9 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.ListViewMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.ListViewArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -193,11 +193,12 @@ void encode_metadata_elementsLen_matchesElementCount() throws Exception { // When EncodeResult result = sut.encode(DTypes.LIST_I32, data, EncodeTestHelper.testCtx()); - EncodingProtos.ListViewMetadata meta = - EncodingProtos.ListViewMetadata.parseFrom(result.rootNode().metadata().duplicate()); + java.nio.ByteBuffer metaBuf = result.rootNode().metadata().duplicate(); + java.lang.foreign.MemorySegment metaSeg = java.lang.foreign.MemorySegment.ofBuffer(metaBuf); + ListViewMetadata meta = ListViewMetadata.decode(metaSeg, 0, metaSeg.byteSize()); // Then - assertThat(meta.getElementsLen()).isEqualTo(5); + assertThat(meta.elements_len()).isEqualTo(5); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/PatchedEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/PatchedEncodingTest.java index 03e78841..66501d60 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/PatchedEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/PatchedEncodingTest.java @@ -1,5 +1,6 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.PatchedMetadata; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.array.Array; @@ -21,32 +22,8 @@ class PatchedEncodingTest { - // Build metadata bytes for PatchedMetadata { n_patches=field1, n_lanes=field2, offset=field3 } - // Proto3 varint encoding: tag = (fieldNumber << 3) | wireType(0) private static ByteBuffer patchedMeta(int nPatches, int nLanes, int offset) { - byte[] buf = new byte[12]; - int pos = 0; - // field 1: n_patches - buf[pos++] = 0x08; - pos = writeVarint(buf, pos, nPatches); - // field 2: n_lanes - buf[pos++] = 0x10; - pos = writeVarint(buf, pos, nLanes); - // field 3: offset (skip if 0 — proto3 omits default values) - if (offset != 0) { - buf[pos++] = 0x18; - pos = writeVarint(buf, pos, offset); - } - return ByteBuffer.wrap(buf, 0, pos); - } - - private static int writeVarint(byte[] buf, int pos, int value) { - while ((value & ~0x7F) != 0) { - buf[pos++] = (byte) ((value & 0x7F) | 0x80); - value >>>= 7; - } - buf[pos++] = (byte) value; - return pos; + return ByteBuffer.wrap(new PatchedMetadata(nPatches, nLanes, offset).encode()); } private static MemorySegment i32Segment(int... values) { diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/PatchesBroadcastRegressionTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/PatchesBroadcastRegressionTest.java index 919919a4..2882d576 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/PatchesBroadcastRegressionTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/PatchesBroadcastRegressionTest.java @@ -1,13 +1,13 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.BitPackedMetadata; +import io.github.dfa1.vortex.proto.PatchesMetadata; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; import org.junit.jupiter.api.Test; +import io.github.dfa1.vortex.proto.ScalarValue; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -43,29 +43,17 @@ void bitpackedDecode_withConstantPatchesValues_broadcastsValueAcrossPatches() { // Indices constant scalar (single U32 = 2 — all three patches will "see" index 2). // The indices being constant is also a broadcast case for the idx side. - ScalarProtos.ScalarValue idxScalar = ScalarProtos.ScalarValue.newBuilder() - .setUint64Value(2L) - .build(); - byte[] idxScalarBytes = idxScalar.toByteArray(); + ScalarValue idxScalar = ScalarValue.ofUint64Value(2L); + byte[] idxScalarBytes = idxScalar.encode(); // Values constant scalar (single I64 = 42). - ScalarProtos.ScalarValue valScalar = ScalarProtos.ScalarValue.newBuilder() - .setInt64Value(constantPatchValue) - .build(); - byte[] valScalarBytes = valScalar.toByteArray(); + ScalarValue valScalar = ScalarValue.ofInt64Value(constantPatchValue); + byte[] valScalarBytes = valScalar.encode(); // Bitpacked metadata: bitWidth=1, patches{...}. - EncodingProtos.PatchesMetadata patches = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(numPatches) - .setOffset(0) - .setIndicesPtype(DTypeProtos.PType.U32) - .build(); - EncodingProtos.BitPackedMetadata meta = EncodingProtos.BitPackedMetadata.newBuilder() - .setBitWidth(1) - .setOffset(0) - .setPatches(patches) - .build(); - ByteBuffer metaBuf = ByteBuffer.wrap(meta.toByteArray()).order(ByteOrder.LITTLE_ENDIAN); + PatchesMetadata patches = new PatchesMetadata(numPatches, 0, io.github.dfa1.vortex.proto.PType.U32, null, null, null); + BitPackedMetadata meta = new BitPackedMetadata(1, 0, patches); + ByteBuffer metaBuf = ByteBuffer.wrap(meta.encode()).order(ByteOrder.LITTLE_ENDIAN); // Buffers: [packed, idxConstantScalar, valConstantScalar] try (Arena arena = Arena.ofConfined()) { diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/PcoEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/PcoEncodingTest.java index 9fa42313..dc462dcc 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/PcoEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/PcoEncodingTest.java @@ -1,12 +1,13 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.ByteString; +import io.github.dfa1.vortex.proto.PcoChunkInfo; +import io.github.dfa1.vortex.proto.PcoMetadata; +import io.github.dfa1.vortex.proto.PcoPageInfo; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -27,10 +28,8 @@ class PcoEncodingTest { private static ByteBuffer validMetaBuffer() { - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR})) - .build(); - return ByteBuffer.wrap(meta.toByteArray()); + PcoMetadata meta = new PcoMetadata(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR}, java.util.List.of()); + return ByteBuffer.wrap(meta.encode()); } private static DecodeContext ctxWith(ByteBuffer meta, DType dtype, long rowCount, MemorySegment[] buffers) { @@ -79,13 +78,10 @@ private static MemorySegment segmentOf(byte... bytes) { /// Build a PcoMetadata proto with one chunk containing one page of {@code nValues} values. private static ByteBuffer metaWithOneChunk(int nValues) { - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR})) - .addChunks(EncodingProtos.PcoChunkInfo.newBuilder() - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(nValues).build()) - .build()) - .build(); - return ByteBuffer.wrap(meta.toByteArray()); + PcoMetadata meta = new PcoMetadata( + new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR}, + java.util.List.of(new PcoChunkInfo(java.util.List.of(new PcoPageInfo(nValues))))); + return ByteBuffer.wrap(meta.encode()); } /// Chunk-meta bytes for Classic mode, Consecutive delta at {@code order}, ansSizeLog=0, nBins=0. @@ -237,10 +233,8 @@ void decode_nullMetadata_throwsMissingMeta() { void decode_invalidHeaderVersion_throwsUnsupported() { // Given var sut = new PcoEncoding(); - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{0x03, 0x00})) - .build(); - DecodeContext ctx = ctxWith(ByteBuffer.wrap(meta.toByteArray()), + PcoMetadata meta = new PcoMetadata(new byte[]{0x03, 0x00}, java.util.List.of()); + DecodeContext ctx = ctxWith(ByteBuffer.wrap(meta.encode()), new DType.Primitive(PType.I64, false), 0, new MemorySegment[0]); // When / Then @@ -334,15 +328,11 @@ void decode_multiPage_singleChunk_decodes() { // Given — 1 chunk, 2 pages each containing 1 value (Consecutive order=1). // buffers: [chunkMeta, page0, page1]; page0 moment=10→value 10, page1 moment=20→value 20. var sut = new PcoEncoding(); - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR})) - .addChunks(EncodingProtos.PcoChunkInfo.newBuilder() - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .build()) - .build(); + PcoMetadata meta = new PcoMetadata( + new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR}, + java.util.List.of(new PcoChunkInfo(java.util.List.of(new PcoPageInfo(1), new PcoPageInfo(1))))); DecodeContext ctx = ctxWith( - ByteBuffer.wrap(meta.toByteArray()), + ByteBuffer.wrap(meta.encode()), new DType.Primitive(PType.U64, false), 2, new MemorySegment[]{chunkMetaConsecutive(1), pageWithMoments(10L), pageWithMoments(20L)}); @@ -361,17 +351,13 @@ void decode_multiChunk_decodes() { // Given — 2 chunks each with 1 page containing 1 value (Consecutive order=1). // buffers: [chunkMeta0, page0, chunkMeta1, page1]; values=[100, 200]. var sut = new PcoEncoding(); - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR})) - .addChunks(EncodingProtos.PcoChunkInfo.newBuilder() - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .build()) - .addChunks(EncodingProtos.PcoChunkInfo.newBuilder() - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .build()) - .build(); + PcoMetadata meta = new PcoMetadata( + new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR}, + java.util.List.of( + new PcoChunkInfo(java.util.List.of(new PcoPageInfo(1))), + new PcoChunkInfo(java.util.List.of(new PcoPageInfo(1))))); DecodeContext ctx = ctxWith( - ByteBuffer.wrap(meta.toByteArray()), + ByteBuffer.wrap(meta.encode()), new DType.Primitive(PType.U64, false), 2, new MemorySegment[]{ @@ -397,16 +383,12 @@ void decode_nullable_someNulls_scattersCorrectly() { // Validity bits LSB-first: bit0=1, bit1=0, bit2=1 → byte 0x05. // Pco encodes only valid values: 1 chunk, 2 pages of nValues=1 (Consecutive order=1). var sut = new PcoEncoding(); - EncodingProtos.PcoMetadata meta = EncodingProtos.PcoMetadata.newBuilder() - .setHeader(ByteString.copyFrom(new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR})) - .addChunks(EncodingProtos.PcoChunkInfo.newBuilder() - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .addPages(EncodingProtos.PcoPageInfo.newBuilder().setNValues(1).build()) - .build()) - .build(); + PcoMetadata meta = new PcoMetadata( + new byte[]{PcoEncoding.PCO_FORMAT_MAJOR, PcoEncoding.PCO_FORMAT_MINOR}, + java.util.List.of(new PcoChunkInfo(java.util.List.of(new PcoPageInfo(1), new PcoPageInfo(1))))); MemorySegment validityBuf = segmentOf((byte) 0x05); // bits: 1,0,1 DecodeContext ctx = ctxWithValidity( - ByteBuffer.wrap(meta.toByteArray()), + ByteBuffer.wrap(meta.encode()), new DType.Primitive(PType.U64, true), 3, validityBuf, diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/RleEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/RleEncodingTest.java index 2c1e0cba..f7adef03 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/RleEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/RleEncodingTest.java @@ -1,5 +1,6 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.RLEMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; @@ -7,7 +8,6 @@ import io.github.dfa1.vortex.core.array.ArraySegments; import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.MaskedArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -353,13 +353,13 @@ void encode_i32_metadata_valuesLen_matchesRunCount() throws Exception { // When EncodeResult result = sut.encode(DTypes.I32, data, EncodeTestHelper.testCtx()); - EncodingProtos.RLEMetadata meta = - EncodingProtos.RLEMetadata.parseFrom(result.rootNode().metadata().duplicate()); + RLEMetadata meta = + RLEMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getValuesLen()).isEqualTo(2); - assertThat(meta.getIndicesLen()).isGreaterThan(0); - assertThat(meta.getIndicesPtypeValue()).isEqualTo(1); // U16 + assertThat(meta.values_len()).isEqualTo(2); + assertThat(meta.indices_len()).isGreaterThan(0); + assertThat(meta.indices_ptype().value()).isEqualTo(1); // U16 } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/RunEndEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/RunEndEncodingTest.java index 88b3cae2..1fb239ee 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/RunEndEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/RunEndEncodingTest.java @@ -1,12 +1,11 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.RunEndMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.ArraySegments; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -28,12 +27,8 @@ private static DecodeContext buildCtx( DType dtype, long rowCount, long[] ends, long[] values, PType endsPtype, long offset ) { - byte[] metaBytes = EncodingProtos.RunEndMetadata.newBuilder() - .setEndsPtype(DTypeProtos.PType.forNumber(endsPtype.ordinal())) - .setNumRuns(ends.length) - .setOffset(offset) - .build() - .toByteArray(); + byte[] metaBytes = new RunEndMetadata(io.github.dfa1.vortex.proto.PType.fromValue(endsPtype.ordinal()), ends.length, offset) + .encode(); byte[] endsBuf = toLEBytes(ends, endsPtype); byte[] valBuf = toLEBytes(values, PType.I64); @@ -176,12 +171,12 @@ void encode_i64_metadata_numRuns_andEndsPtype() throws Exception { // When EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); - EncodingProtos.RunEndMetadata meta = - EncodingProtos.RunEndMetadata.parseFrom(result.rootNode().metadata().duplicate()); + RunEndMetadata meta = + RunEndMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getNumRuns()).isEqualTo(3); - assertThat(meta.getEndsPtypeValue()).isEqualTo(2); // U32 + assertThat(meta.num_runs()).isEqualTo(3); + assertThat(meta.ends_ptype().value()).isEqualTo(2); // U32 } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/SequenceEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/SequenceEncodingTest.java index 182e4490..7e5981b4 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/SequenceEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/SequenceEncodingTest.java @@ -8,8 +8,8 @@ import io.github.dfa1.vortex.core.array.FloatArray; import io.github.dfa1.vortex.core.array.IntArray; import io.github.dfa1.vortex.core.array.LongArray; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; +import io.github.dfa1.vortex.proto.ScalarValue; +import io.github.dfa1.vortex.proto.SequenceMetadata; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -144,31 +144,21 @@ private static DecodeContext makeCtx(byte[] meta, DType dtype, long n) { } private static byte[] intMeta(long base, long mul) { - return EncodingProtos.SequenceMetadata.newBuilder() - .setBase(ScalarProtos.ScalarValue.newBuilder().setInt64Value(base)) - .setMultiplier(ScalarProtos.ScalarValue.newBuilder().setInt64Value(mul)) - .build().toByteArray(); + return new SequenceMetadata(ScalarValue.ofInt64Value(base), ScalarValue.ofInt64Value(mul)).encode(); } private static byte[] f64Meta(double base, double mul) { - return EncodingProtos.SequenceMetadata.newBuilder() - .setBase(ScalarProtos.ScalarValue.newBuilder().setF64Value(base)) - .setMultiplier(ScalarProtos.ScalarValue.newBuilder().setF64Value(mul)) - .build().toByteArray(); + return new SequenceMetadata(ScalarValue.ofF64Value(base), ScalarValue.ofF64Value(mul)).encode(); } private static byte[] f32Meta(float base, float mul) { - return EncodingProtos.SequenceMetadata.newBuilder() - .setBase(ScalarProtos.ScalarValue.newBuilder().setF32Value(base)) - .setMultiplier(ScalarProtos.ScalarValue.newBuilder().setF32Value(mul)) - .build().toByteArray(); + return new SequenceMetadata(ScalarValue.ofF32Value(base), ScalarValue.ofF32Value(mul)).encode(); } private static byte[] f16Meta(short baseShort, short mulShort) { - return EncodingProtos.SequenceMetadata.newBuilder() - .setBase(ScalarProtos.ScalarValue.newBuilder().setF16Value(Short.toUnsignedLong(baseShort))) - .setMultiplier(ScalarProtos.ScalarValue.newBuilder().setF16Value(Short.toUnsignedLong(mulShort))) - .build().toByteArray(); + return new SequenceMetadata( + ScalarValue.ofF16Value(Short.toUnsignedLong(baseShort)), + ScalarValue.ofF16Value(Short.toUnsignedLong(mulShort))).encode(); } @ParameterizedTest @@ -312,14 +302,14 @@ void encode_i64_metadata_base_andMultiplier_areSet() throws Exception { // When EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); - EncodingProtos.SequenceMetadata meta = - EncodingProtos.SequenceMetadata.parseFrom(result.rootNode().metadata().duplicate()); + MemorySegment metaSeg = MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()); + SequenceMetadata meta = SequenceMetadata.decode(metaSeg, 0, metaSeg.byteSize()); // Then - assertThat(meta.hasBase()).isTrue(); - assertThat(meta.hasMultiplier()).isTrue(); - assertThat(meta.getBase().getInt64Value()).isEqualTo(10L); - assertThat(meta.getMultiplier().getInt64Value()).isEqualTo(2L); + assertThat(meta.base()).isNotNull(); + assertThat(meta.multiplier()).isNotNull(); + assertThat(meta.base().int64_value()).isEqualTo(10L); + assertThat(meta.multiplier().int64_value()).isEqualTo(2L); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/SparseEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/SparseEncodingTest.java index 300449f7..dee032b9 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/SparseEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/SparseEncodingTest.java @@ -1,7 +1,8 @@ package io.github.dfa1.vortex.encoding; -import com.google.protobuf.InvalidProtocolBufferException; -import com.google.protobuf.NullValue; +import io.github.dfa1.vortex.proto.PatchesMetadata; +import io.github.dfa1.vortex.proto.SparseMetadata; +import io.github.dfa1.vortex.proto.VarBinMetadata; import io.github.dfa1.vortex.core.ArrayStats; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; @@ -9,13 +10,12 @@ import io.github.dfa1.vortex.core.array.ArraySegments; import io.github.dfa1.vortex.core.array.BoolArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.DTypeProtos; -import io.github.dfa1.vortex.proto.EncodingProtos; -import io.github.dfa1.vortex.proto.ScalarProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import io.github.dfa1.vortex.proto.NullValue; +import io.github.dfa1.vortex.proto.ScalarValue; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -52,7 +52,7 @@ private static Array decodeResult(EncodeResult encoded, DType dtype, int n) { } @Test - void encode_allZeros_noPatches() throws InvalidProtocolBufferException { + void encode_allZeros_noPatches() throws java.io.IOException { // Given long[] data = {0L, 0L, 0L, 0L}; SparseEncoding sut = new SparseEncoding(); @@ -61,13 +61,14 @@ void encode_allZeros_noPatches() throws InvalidProtocolBufferException { EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); // Then - EncodingProtos.SparseMetadata meta = EncodingProtos.SparseMetadata.parseFrom( - result.rootNode().metadata().array()); - assertThat(meta.getPatches().getLen()).isZero(); + java.nio.ByteBuffer metaBuf = result.rootNode().metadata().duplicate(); + java.lang.foreign.MemorySegment metaSeg = java.lang.foreign.MemorySegment.ofBuffer(metaBuf); + SparseMetadata meta = SparseMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + assertThat(meta.patches().len()).isZero(); } @Test - void encode_withNonZero_createsPatches() throws InvalidProtocolBufferException { + void encode_withNonZero_createsPatches() throws java.io.IOException { // Given — [0, 10, 0, 50, 0] long[] data = {0L, 10L, 0L, 50L, 0L}; SparseEncoding sut = new SparseEncoding(); @@ -76,9 +77,10 @@ void encode_withNonZero_createsPatches() throws InvalidProtocolBufferException { EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); // Then - EncodingProtos.SparseMetadata meta = EncodingProtos.SparseMetadata.parseFrom( - result.rootNode().metadata().array()); - assertThat(meta.getPatches().getLen()).isEqualTo(2); + java.nio.ByteBuffer metaBuf = result.rootNode().metadata().duplicate(); + java.lang.foreign.MemorySegment metaSeg = java.lang.foreign.MemorySegment.ofBuffer(metaBuf); + SparseMetadata meta = SparseMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + assertThat(meta.patches().len()).isEqualTo(2); } @Test @@ -119,7 +121,7 @@ void encode_roundTrip_f64() { @ParameterizedTest @ValueSource(ints = {0, 1, 100}) - void encode_empty_or_allZero_noPatches(int size) throws InvalidProtocolBufferException { + void encode_empty_or_allZero_noPatches(int size) throws java.io.IOException { // Given long[] data = new long[size]; SparseEncoding sut = new SparseEncoding(); @@ -128,9 +130,10 @@ void encode_empty_or_allZero_noPatches(int size) throws InvalidProtocolBufferExc EncodeResult result = sut.encode(DTypes.I64, data, EncodeTestHelper.testCtx()); // Then - EncodingProtos.SparseMetadata meta = EncodingProtos.SparseMetadata.parseFrom( - result.rootNode().metadata().array()); - assertThat(meta.getPatches().getLen()).isZero(); + java.nio.ByteBuffer metaBuf = result.rootNode().metadata().duplicate(); + java.lang.foreign.MemorySegment metaSeg = java.lang.foreign.MemorySegment.ofBuffer(metaBuf); + SparseMetadata meta = SparseMetadata.decode(metaSeg, 0, metaSeg.byteSize()); + assertThat(meta.patches().len()).isZero(); } } @@ -148,8 +151,7 @@ private static DecodeContext buildSparseCtxWithOffset( DType dtype, long rowCount, long fillLong, PType idxPtype, long[] patchIndices, long[] patchValues, long offset ) { - byte[] fillBytes = ScalarProtos.ScalarValue.newBuilder() - .setInt64Value(fillLong).build().toByteArray(); + byte[] fillBytes = ScalarValue.ofInt64Value(fillLong).encode(); byte[] metaBytes = buildSparseMetaBytes(patchIndices.length, offset, idxPtype); @@ -164,8 +166,7 @@ private static DecodeContext buildSparseCtxF64( DType dtype, long rowCount, double fillDouble, long[] patchIndices, double[] patchValues ) { - byte[] fillBytes = ScalarProtos.ScalarValue.newBuilder() - .setF64Value(fillDouble).build().toByteArray(); + byte[] fillBytes = ScalarValue.ofF64Value(fillDouble).encode(); byte[] metaBytes = buildSparseMetaBytes(patchIndices.length, 0L, PType.U32); byte[] idxBuf = toLEBytes(patchIndices, PType.U32); @@ -203,15 +204,9 @@ private static DecodeContext buildCtx( } private static byte[] buildSparseMetaBytes(long numPatches, long offset, PType idxPtype) { - EncodingProtos.PatchesMetadata patchesMeta = EncodingProtos.PatchesMetadata.newBuilder() - .setLen(numPatches) - .setOffset(offset) - .setIndicesPtype(DTypeProtos.PType.forNumber(idxPtype.ordinal())) - .build(); - return EncodingProtos.SparseMetadata.newBuilder() - .setPatches(patchesMeta) - .build() - .toByteArray(); + PatchesMetadata patchesMeta = new PatchesMetadata(numPatches, offset, io.github.dfa1.vortex.proto.PType.fromValue(idxPtype.ordinal()), null, null, null); + return new SparseMetadata(patchesMeta) + .encode(); } private static byte[] toLEBytes(long[] values, PType ptype) { @@ -327,8 +322,7 @@ void decode_offsetSubtracted() { @Test void decode_nullValueFill_treatedAsZero() { // Given — fill encoded as ScalarValue.NULL_VALUE (as Rust writes for nullable cols) - byte[] nullFill = ScalarProtos.ScalarValue.newBuilder() - .setNullValue(NullValue.NULL_VALUE).build().toByteArray(); + byte[] nullFill = ScalarValue.ofNullValue(NullValue.NULL_VALUE).encode(); byte[] meta = buildSparseMetaBytes(0, 0L, PType.U32); DecodeContext ctx = buildCtx(DTypes.I64, 4, nullFill, meta, new byte[0], new byte[0], new DType.Primitive(PType.U32, false)); @@ -349,8 +343,7 @@ void decode_nullValueFill_treatedAsZero() { void decode_utf8_noPatches_allEmpty() { // Given — Utf8 sparse, no patches → all positions empty (null fill) DType utf8 = new DType.Utf8(true); - byte[] nullFill = ScalarProtos.ScalarValue.newBuilder() - .setNullValue(NullValue.NULL_VALUE).build().toByteArray(); + byte[] nullFill = ScalarValue.ofNullValue(NullValue.NULL_VALUE).encode(); byte[] meta = buildSparseMetaBytes(0, 0L, PType.U32); DecodeContext ctx = buildCtx(utf8, 3, nullFill, meta, new byte[0], new byte[0], new DType.Primitive(PType.U32, false)); @@ -372,16 +365,13 @@ void decode_utf8_noPatches_allEmpty() { void decode_utf8_withPatches_writesStringsAtIndices() { // Given — 5 Utf8 elements, patches at [1]="hi" and [3]="bye" DType utf8 = new DType.Utf8(true); - byte[] nullFill = ScalarProtos.ScalarValue.newBuilder() - .setNullValue(NullValue.NULL_VALUE).build().toByteArray(); + byte[] nullFill = ScalarValue.ofNullValue(NullValue.NULL_VALUE).encode(); byte[] meta = buildSparseMetaBytes(2, 0L, PType.U32); byte[] idxBuf = toLEBytes(new long[]{1L, 3L}, PType.U32); byte[] strBytes = "hibye".getBytes(StandardCharsets.UTF_8); byte[] offsets = intLEBytes(new int[]{0, 2, 5}); - byte[] varBinMeta = EncodingProtos.VarBinMetadata.newBuilder() - .setOffsetsPtype(DTypeProtos.PType.forNumber(PType.I32.ordinal())) - .build().toByteArray(); + byte[] varBinMeta = new VarBinMetadata(io.github.dfa1.vortex.proto.PType.fromValue(PType.I32.ordinal())).encode(); ArrayNode offsetsNode = ArrayNode.of(EncodingId.VORTEX_PRIMITIVE, null, new ArrayNode[0], new int[]{3}, ArrayStats.empty()); @@ -423,8 +413,7 @@ void decode_utf8_withPatches_writesStringsAtIndices() { void decode_bool_withPatches_setsBitsAtIndices() { // Given — 6 Bool elements, patches at [2]=true and [5]=true DType bool = new DType.Bool(true); - byte[] nullFill = ScalarProtos.ScalarValue.newBuilder() - .setNullValue(NullValue.NULL_VALUE).build().toByteArray(); + byte[] nullFill = ScalarValue.ofNullValue(NullValue.NULL_VALUE).encode(); byte[] meta = buildSparseMetaBytes(2, 0L, PType.U32); byte[] idxBuf = toLEBytes(new long[]{2L, 5L}, PType.U32); byte[] boolBits = new byte[]{0b00000011}; diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/VarBinEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/VarBinEncodingTest.java index 627c935c..ab6952b7 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/VarBinEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/VarBinEncodingTest.java @@ -1,10 +1,10 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.VarBinMetadata; import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; import io.github.dfa1.vortex.core.VortexException; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -167,11 +167,11 @@ void encode_utf8_metadata_offsetsPtype_isI64() throws Exception { // When EncodeResult result = sut.encode(DTypes.UTF8, data, EncodeTestHelper.testCtx()); - EncodingProtos.VarBinMetadata meta = - EncodingProtos.VarBinMetadata.parseFrom(result.rootNode().metadata().duplicate()); + VarBinMetadata meta = + VarBinMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getOffsetsPtypeValue()).isEqualTo(7); // I64 + assertThat(meta.offsets_ptype().value()).isEqualTo(7); // I64 } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/VariantEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/VariantEncodingTest.java index a1bebcdb..db660604 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/VariantEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/VariantEncodingTest.java @@ -2,10 +2,11 @@ import io.github.dfa1.vortex.core.DType; import io.github.dfa1.vortex.core.PType; +import io.github.dfa1.vortex.proto.Primitive; +import io.github.dfa1.vortex.proto.VariantMetadata; import io.github.dfa1.vortex.core.array.Array; import io.github.dfa1.vortex.core.array.NullArray; import io.github.dfa1.vortex.core.array.VariantArray; -import io.github.dfa1.vortex.proto.DTypeProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -22,15 +23,8 @@ class VariantEncodingTest { private static final DType VARIANT_DTYPE = new DType.Variant(false); private static final int N = 3; - // Build a DType proto bytes for VariantMetadataProto { shredded_dtype = 1 } - private static ByteBuffer variantMetaWithShredded(DTypeProtos.DType shredded) { - byte[] dtypeBytes = shredded.toByteArray(); - // field 1, wire type 2 (length-delimited): tag = 0x0A, then varint length, then bytes - byte[] meta = new byte[1 + 1 + dtypeBytes.length]; - meta[0] = 0x0A; - meta[1] = (byte) dtypeBytes.length; - System.arraycopy(dtypeBytes, 0, meta, 2, dtypeBytes.length); - return ByteBuffer.wrap(meta); + private static ByteBuffer variantMetaWithShredded(io.github.dfa1.vortex.proto.DType shredded) { + return ByteBuffer.wrap(new VariantMetadata(shredded).encode()); } // Build inner / shredded child nodes backed by primitive buffer at the given segment index. @@ -81,12 +75,8 @@ void decode_withoutShredded_returnsCoreStorageOnly() { @Test void decode_withShredded_decodesSecondChild() { // Given — 2 children: null core_storage + primitive shredded; metadata encodes I32 dtype - DTypeProtos.DType shreddedProto = DTypeProtos.DType.newBuilder() - .setPrimitive(DTypeProtos.Primitive.newBuilder() - .setType(DTypeProtos.PType.I32) - .setNullable(false) - .build()) - .build(); + io.github.dfa1.vortex.proto.DType shreddedProto = io.github.dfa1.vortex.proto.DType.ofPrimitive( + new Primitive(io.github.dfa1.vortex.proto.PType.I32, false)); ByteBuffer meta = variantMetaWithShredded(shreddedProto); ArrayNode coreNode = nullChildNode(); diff --git a/core/src/test/java/io/github/dfa1/vortex/encoding/ZstdEncodingTest.java b/core/src/test/java/io/github/dfa1/vortex/encoding/ZstdEncodingTest.java index 7c833b8e..b1b0eaff 100644 --- a/core/src/test/java/io/github/dfa1/vortex/encoding/ZstdEncodingTest.java +++ b/core/src/test/java/io/github/dfa1/vortex/encoding/ZstdEncodingTest.java @@ -1,5 +1,7 @@ package io.github.dfa1.vortex.encoding; +import io.github.dfa1.vortex.proto.ZstdFrameMetadata; +import io.github.dfa1.vortex.proto.ZstdMetadata; import com.github.luben.zstd.ZstdCompressCtx; import io.airlift.compress.v3.zstd.ZstdCompressor; import io.airlift.compress.v3.zstd.ZstdJavaCompressor; @@ -10,7 +12,6 @@ import io.github.dfa1.vortex.core.array.LongArray; import io.github.dfa1.vortex.core.array.MaskedArray; import io.github.dfa1.vortex.core.array.VarBinArray; -import io.github.dfa1.vortex.proto.EncodingProtos; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -190,17 +191,6 @@ private static ArrayNode toArrayNode(EncodeNode enc) { return ArrayNode.of(enc.encodingId(), enc.metadata(), children, enc.bufferIndices(), null); } - private static byte[] metaNoDict(long[] uncompressedSizes, long[] nValues) { - EncodingProtos.ZstdMetadata.Builder builder = EncodingProtos.ZstdMetadata.newBuilder() - .setDictionarySize(0); - for (int i = 0; i < uncompressedSizes.length; i++) { - builder.addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(uncompressedSizes[i]) - .setNValues(nValues[i])); - } - return builder.build().toByteArray(); - } - private static DecodeContext makeCtx(byte[] meta, DType dtype, long n, byte[]... compressedFrames) { MemorySegment[] segments = new MemorySegment[compressedFrames.length]; int[] bufIndices = new int[compressedFrames.length]; @@ -220,6 +210,14 @@ private static byte[] compress(byte[] input) { return Arrays.copyOf(out, len); } + private static byte[] metaNoDict(long[] uncompressedSizes, long[] nValues) { + java.util.List frames = new java.util.ArrayList<>(); + for (int i = 0; i < uncompressedSizes.length; i++) { + frames.add(new ZstdFrameMetadata(uncompressedSizes[i], nValues[i])); + } + return new ZstdMetadata(0, frames).encode(); + } + private static byte[] toLeBytes(int[] values) { ByteBuffer buf = ByteBuffer.allocate(values.length * 4).order(ByteOrder.LITTLE_ENDIAN); for (int v : values) { @@ -250,138 +248,6 @@ private static byte[] toLengthPrefixed(String[] strings) { return buf.array(); } - @Test - void decode_primitiveI32_singleFrame_roundTrips() { - // Given - var sut = new ZstdEncoding(); - int[] values = {10, 20, 30, 40}; - byte[] raw = toLeBytes(values); - byte[] compressed = compress(raw); - DecodeContext ctx = makeCtx( - metaNoDict(new long[]{raw.length}, new long[]{values.length}), - DTypes.I32, values.length, compressed - ); - - // When - IntArray result = (IntArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isEqualTo(values.length); - for (int i = 0; i < values.length; i++) { - assertThat(result.getInt(i)).as("index %d", i).isEqualTo(values[i]); - } - } - - @Test - void decode_primitiveI64_singleFrame_roundTrips() { - // Given - var sut = new ZstdEncoding(); - long[] values = {100L, 200L, 300L}; - byte[] raw = toLeBytes(values); - byte[] compressed = compress(raw); - DecodeContext ctx = makeCtx( - metaNoDict(new long[]{raw.length}, new long[]{values.length}), - DTypes.I64, values.length, compressed - ); - - // When - LongArray result = (LongArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isEqualTo(values.length); - for (int i = 0; i < values.length; i++) { - assertThat(result.getLong(i)).as("index %d", i).isEqualTo(values[i]); - } - } - - @Test - void decode_utf8_singleFrame_roundTrips() { - // Given - var sut = new ZstdEncoding(); - String[] strings = {"hello", "world", "zstd"}; - byte[] raw = toLengthPrefixed(strings); - byte[] compressed = compress(raw); - DecodeContext ctx = makeCtx( - metaNoDict(new long[]{raw.length}, new long[]{strings.length}), - DTypes.UTF8, strings.length, compressed - ); - - // When - VarBinArray result = (VarBinArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isEqualTo(strings.length); - for (int i = 0; i < strings.length; i++) { - assertThat(result.getString(i)).as("index %d", i).isEqualTo(strings[i]); - } - } - - @Test - void decode_primitiveI32_multipleFrames_roundTrips() { - // Given - var sut = new ZstdEncoding(); - int[] frame0Values = {1, 2, 3}; - int[] frame1Values = {4, 5}; - byte[] raw0 = toLeBytes(frame0Values); - byte[] raw1 = toLeBytes(frame1Values); - byte[] comp0 = compress(raw0); - byte[] comp1 = compress(raw1); - byte[] meta = metaNoDict( - new long[]{raw0.length, raw1.length}, - new long[]{frame0Values.length, frame1Values.length} - ); - DecodeContext ctx = makeCtx(meta, DTypes.I32, 5, comp0, comp1); - - // When - IntArray result = (IntArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isEqualTo(5); - assertThat(result.getInt(0)).isEqualTo(1); - assertThat(result.getInt(4)).isEqualTo(5); - } - - @Test - void decode_emptyArray_returnsZeroLengthArray() { - // Given - var sut = new ZstdEncoding(); - byte[] meta = metaNoDict(new long[0], new long[0]); - DecodeContext ctx = makeCtx(meta, DTypes.I32, 0); - - // When - IntArray result = (IntArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isZero(); - } - - @Test - void decode_withDictionary_primitive_roundTrips() { - // Given - var sut = new ZstdEncoding(); - int[] values = {10, 20, 30, 40}; - byte[] raw = toLeBytes(values); - byte[] dictBytes = makeDictFor(raw); - byte[] compressed = compressWithDict(raw, dictBytes); - byte[] meta = EncodingProtos.ZstdMetadata.newBuilder() - .setDictionarySize(dictBytes.length) - .addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(raw.length) - .setNValues(values.length)) - .build().toByteArray(); - // buffer[0]=dict, buffer[1]=frame - DecodeContext ctx = makeDictCtx(meta, DTypes.I32, values.length, dictBytes, compressed); - - // When - IntArray result = (IntArray) sut.decode(ctx); - - // Then - assertThat(result.length()).isEqualTo(values.length); - for (int i = 0; i < values.length; i++) { - assertThat(result.getInt(i)).as("index %d", i).isEqualTo(values[i]); - } - } - @Test void decode_withDictionary_utf8_roundTrips() { // Given @@ -390,12 +256,8 @@ void decode_withDictionary_utf8_roundTrips() { byte[] raw = toLengthPrefixed(strings); byte[] dictBytes = makeDictFor(raw); byte[] compressed = compressWithDict(raw, dictBytes); - byte[] meta = EncodingProtos.ZstdMetadata.newBuilder() - .setDictionarySize(dictBytes.length) - .addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(raw.length) - .setNValues(strings.length)) - .build().toByteArray(); + byte[] meta = new ZstdMetadata(dictBytes.length, + java.util.List.of(new ZstdFrameMetadata(raw.length, strings.length))).encode(); DecodeContext ctx = makeDictCtx(meta, DTypes.UTF8, strings.length, dictBytes, compressed); // When @@ -419,13 +281,9 @@ void decode_withDictionary_multipleFrames_roundTrips() { byte[] dictBytes = makeDictFor(raw0, raw1); byte[] comp0 = compressWithDict(raw0, dictBytes); byte[] comp1 = compressWithDict(raw1, dictBytes); - byte[] meta = EncodingProtos.ZstdMetadata.newBuilder() - .setDictionarySize(dictBytes.length) - .addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(raw0.length).setNValues(frame0.length)) - .addFrames(EncodingProtos.ZstdFrameMetadata.newBuilder() - .setUncompressedSize(raw1.length).setNValues(frame1.length)) - .build().toByteArray(); + byte[] meta = new ZstdMetadata(dictBytes.length, java.util.List.of( + new ZstdFrameMetadata(raw0.length, frame0.length), + new ZstdFrameMetadata(raw1.length, frame1.length))).encode(); DecodeContext ctx = makeDictCtx(meta, DTypes.I32, 5, dictBytes, comp0, comp1); // When @@ -549,11 +407,11 @@ void encode_i32_metadata_framesCount_isNonZero() throws Exception { // When EncodeResult result = sut.encode(DTypes.I32, data, EncodeTestHelper.testCtx()); - EncodingProtos.ZstdMetadata meta = - EncodingProtos.ZstdMetadata.parseFrom(result.rootNode().metadata().duplicate()); + ZstdMetadata meta = + ZstdMetadata.decode(java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()), 0, java.lang.foreign.MemorySegment.ofBuffer(result.rootNode().metadata().duplicate()).byteSize()); // Then - assertThat(meta.getFramesCount()).isGreaterThan(0); + assertThat(meta.frames().size()).isGreaterThan(0); } } } diff --git a/core/src/test/java/io/github/dfa1/vortex/proto/ProtoRuntimeTest.java b/core/src/test/java/io/github/dfa1/vortex/proto/ProtoRuntimeTest.java new file mode 100644 index 00000000..718acdf5 --- /dev/null +++ b/core/src/test/java/io/github/dfa1/vortex/proto/ProtoRuntimeTest.java @@ -0,0 +1,361 @@ +package io.github.dfa1.vortex.proto; + +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +import java.io.IOException; +import java.lang.foreign.MemorySegment; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +class ProtoRuntimeTest { + + @Nested + class Varint { + + @ParameterizedTest + @ValueSource(longs = {0L, 1L, 127L, 128L, 150L, 16383L, 16384L, 0x7fffffffL, Long.MAX_VALUE, -1L, Long.MIN_VALUE}) + void roundTripsVarint64(long value) throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeVarint64(value); + byte[] bytes = w.toByteArray(); + + // When + ProtoReader r = readerOver(bytes); + + // Then + assertThat(r.readVarint64()).isEqualTo(value); + assertThat(r.hasMore()).isFalse(); + } + + @Test + void varintCanonicalEncodingOf150() throws IOException { + // Given — proto3 spec example: 150 encodes as 0x96 0x01. + ProtoWriter w = new ProtoWriter(); + w.writeVarint64(150L); + + // When + byte[] bytes = w.toByteArray(); + + // Then + assertThat(bytes).containsExactly(0x96, 0x01); + } + + @Test + void truncatedVarintThrows() { + // Given — MSB set on last byte means more bytes expected. + MemorySegment seg = MemorySegment.ofArray(new byte[]{(byte) 0x80}); + + // When + Then + assertThatThrownBy(() -> new ProtoReader(seg, 0, 1).readVarint64()) + .isInstanceOf(IOException.class) + .hasMessageContaining("truncated varint"); + } + } + + @Nested + class Sint { + + @ParameterizedTest + @ValueSource(longs = {0L, -1L, 1L, -2L, 2L, Long.MIN_VALUE, Long.MAX_VALUE}) + void roundTripsZigzag(long value) throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeSint64(value); + + // When + long decoded = readerOver(w.toByteArray()).readSint64(); + + // Then + assertThat(decoded).isEqualTo(value); + } + } + + @Nested + class Fixed { + + @ParameterizedTest + @ValueSource(ints = {0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE, 0x12345678}) + void roundTripsFixed32(int value) throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeFixed32(value); + + // When + Then + assertThat(readerOver(w.toByteArray()).readFixed32()).isEqualTo(value); + } + + @ParameterizedTest + @ValueSource(longs = {0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE, 0x123456789abcdef0L}) + void roundTripsFixed64(long value) throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeFixed64(value); + + // When + Then + assertThat(readerOver(w.toByteArray()).readFixed64()).isEqualTo(value); + } + + @Test + void roundTripsFloatAndDouble() throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeFloat(3.14f); + w.writeDouble(Math.PI); + + // When + ProtoReader r = readerOver(w.toByteArray()); + + // Then + assertThat(r.readFloat()).isEqualTo(3.14f); + assertThat(r.readDouble()).isEqualTo(Math.PI); + } + } + + @Nested + class LengthDelimited { + + @Test + void roundTripsString() throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeString("hello 世界"); + + // When + String s = readerOver(w.toByteArray()).readString(); + + // Then + assertThat(s).isEqualTo("hello 世界"); + } + + @Test + void roundTripsBytes() throws IOException { + // Given + byte[] payload = {1, 2, 3, 4, 5}; + ProtoWriter w = new ProtoWriter(); + w.writeBytes(payload); + + // When + byte[] decoded = readerOver(w.toByteArray()).readBytes(); + + // Then + assertThat(decoded).containsExactly(payload); + } + + @Test + void lenDelimSegmentIsZeroCopy() throws IOException { + // Given + byte[] payload = {10, 20, 30, 40}; + ProtoWriter w = new ProtoWriter(); + w.writeBytes(payload); + MemorySegment src = MemorySegment.ofArray(w.toByteArray()); + + // When + MemorySegment slice = new ProtoReader(src, 0, src.byteSize()).readLenDelimSegment(); + + // Then — slice points into the original segment, not a fresh copy. + assertThat(slice.byteSize()).isEqualTo(payload.length); + assertThat(slice.address()).isEqualTo(src.address() + 1); // skip 1-byte length varint + } + + @Test + void truncatedLenDelimThrows() { + // Given — length=10 but only 2 bytes follow. + MemorySegment seg = MemorySegment.ofArray(new byte[]{10, 1, 2}); + + // When + Then + assertThatThrownBy(() -> new ProtoReader(seg, 0, 3).readBytes()) + .isInstanceOf(IOException.class) + .hasMessageContaining("truncated"); + } + } + + @Nested + class Tag { + + @Test + void tagRoundTrip() throws IOException { + // Given + ProtoWriter w = new ProtoWriter(); + w.writeTag(5, WireType.LEN); + + // When + int tag = readerOver(w.toByteArray()).readVarint32(); + + // Then + assertThat(tag >>> 3).isEqualTo(5); + assertThat(tag & 7).isEqualTo(WireType.LEN); + } + } + + @Nested + class Skip { + + @Test + void skipsAllFourWireTypes() throws IOException { + // Given — one of each wire type. + ProtoWriter w = new ProtoWriter(); + w.writeTag(1, WireType.VARINT); + w.writeVarint64(150); + w.writeTag(2, WireType.FIXED32); + w.writeFixed32(42); + w.writeTag(3, WireType.FIXED64); + w.writeFixed64(42L); + w.writeTag(4, WireType.LEN); + w.writeBytes(new byte[]{1, 2, 3}); + + ProtoReader r = readerOver(w.toByteArray()); + + // When — skip each field after reading its tag. + for (int i = 0; i < 4; i++) { + int tag = r.readVarint32(); + r.skipField(tag & 7); + } + + // Then + assertThat(r.hasMore()).isFalse(); + } + } + + @Nested + class PackedRepeated { + + @Test + void readsPackedVarintRegion() throws IOException { + // Given — 3 varints packed inside a length-delim region: lengths 1+1+2 = 4 bytes. + ProtoWriter inner = new ProtoWriter(); + inner.writeVarint64(1); + inner.writeVarint64(127); + inner.writeVarint64(128); + byte[] packed = inner.toByteArray(); + + // Outer wrapper: just the payload (no tag prefix), simulating the LEN body. + MemorySegment seg = MemorySegment.ofArray(packed); + ProtoReader r = new ProtoReader(seg, 0, packed.length); + + // When + long[] out = new long[3]; + int[] idx = {0}; + r.readPacked(packed.length, reader -> out[idx[0]++] = reader.readVarint64()); + + // Then + assertThat(out).containsExactly(1, 127, 128); + } + } + + @Nested + class VarintOverflow { + + @Test + void elevenContinuationBytesThrows() { + // Given — 11 bytes with MSB set: exceeds the 10-byte varint64 limit. + // The reader must throw "varint overflow" rather than silently truncating. + byte[] bytes = new byte[11]; + for (int i = 0; i < 11; i++) { + bytes[i] = (byte) 0xff; + } + MemorySegment seg = MemorySegment.ofArray(bytes); + + // When + Then + assertThatThrownBy(() -> new ProtoReader(seg, 0, 11).readVarint64()) + .isInstanceOf(IOException.class) + .hasMessageContaining("varint overflow"); + } + } + + @Nested + class UnknownEnum { + + @Test + void unknownPTypeValueIsCheckedIOException() { + // Given — Primitive { type = 99 } where PType has no constant for 99. + // Field tag 1, wire type VARINT (0): tag byte = (1 << 3) | 0 = 0x08, value 99 = 0x63. + byte[] wire = new byte[]{0x08, 0x63}; + MemorySegment seg = MemorySegment.ofArray(wire); + + // When + Then — must be checked IOException (per SECURITY.md guarantee), + // not the underlying IllegalArgumentException from Enum.fromValue. + assertThatThrownBy(() -> Primitive.decode(seg, 0, wire.length)) + .isInstanceOf(IOException.class) + .hasMessageContaining("PType"); + } + } + + @Nested + class SingleNullEncode { + + @Test + void singleStringNullEncodesEmpty() { + // Given — Extension with all SINGLE fields null. Pre-fix this NPE'd on + // String.isEmpty() / byte[].length. Default-value SINGLE fields must skip + // emitting the tag entirely. + Extension ext = new Extension(null, null, null); + + // When + byte[] wire = ext.encode(); + + // Then — no fields emitted, no NPE. + assertThat(wire).isEmpty(); + } + } + + @Nested + class ByteArrayEquality { + + @Test + void recordsWithEqualByteArraysAreEqual() { + // Given — records auto-equals would do reference compare on byte[]. The + // generator overrides equals/hashCode with Arrays.equals/Arrays.hashCode + // so structurally equal records compare equal. + ScalarValue a = ScalarValue.ofBytesValue(new byte[]{1, 2, 3}); + ScalarValue b = ScalarValue.ofBytesValue(new byte[]{1, 2, 3}); + + // When + Then + assertThat(a).isEqualTo(b); + assertThat(a.hashCode()).isEqualTo(b.hashCode()); + } + + @Test + void recordsWithDifferentByteArraysAreNotEqual() { + // Given + ScalarValue a = ScalarValue.ofBytesValue(new byte[]{1, 2, 3}); + ScalarValue b = ScalarValue.ofBytesValue(new byte[]{1, 2, 4}); + + // When + Then + assertThat(a).isNotEqualTo(b); + } + } + + @Nested + class Bounds { + + @Test + void constructorRejectsOutOfRangeOffset() { + // Given + MemorySegment seg = MemorySegment.ofArray(new byte[10]); + + // When + Then + assertThatThrownBy(() -> new ProtoReader(seg, 5, 10)) + .isInstanceOf(IndexOutOfBoundsException.class); + } + + @Test + void constructorRejectsNegativeLength() { + // Given + MemorySegment seg = MemorySegment.ofArray(new byte[10]); + + // When + Then + assertThatThrownBy(() -> new ProtoReader(seg, 0, -1)) + .isInstanceOf(IndexOutOfBoundsException.class); + } + } + + private static ProtoReader readerOver(byte[] bytes) { + MemorySegment seg = MemorySegment.ofArray(bytes); + return new ProtoReader(seg, 0, seg.byteSize()); + } +} diff --git a/pom.xml b/pom.xml index 59daaea6..ae1c9507 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,7 @@ + proto-gen core reader writer @@ -58,7 +59,6 @@ 3.6 1.5.7-10 25.2.10 - 4.35.0 4.3.0 1.0.0.CR1 1.37 @@ -140,11 +140,6 @@ flatbuffers-java ${flatbuffers.version} - - com.google.protobuf - protobuf-java - ${protobuf.version} - org.openjdk.jmh jmh-core diff --git a/proto-gen/pom.xml b/proto-gen/pom.xml new file mode 100644 index 00000000..ea05c531 --- /dev/null +++ b/proto-gen/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + io.github.dfa1.vortex + vortex-java + 0.6.0-SNAPSHOT + + + vortex-proto-gen + + vortex-proto-gen + Build-time .proto to MemorySegment-native Java code generator. Not published. + + + true + + + + + + org.junit.jupiter + junit-jupiter + test + + + org.assertj + assertj-core + test + + + diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Ast.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Ast.java new file mode 100644 index 00000000..f1fd623f --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Ast.java @@ -0,0 +1,85 @@ +package io.github.dfa1.vortex.protogen; + +import java.util.List; +import java.util.Optional; + +/// Container for the {@code .proto} AST node records. +/// Nested types are kept here so consumers import a single class. +public final class Ast { + + private Ast() { + } + + /// A parsed {@code .proto} source file. + /// + /// @param protoPackage value of the {@code package} declaration, or empty + /// @param javaPackage value of {@code option java_package = "..."}, or empty + /// @param imports list of imported file paths (relative to include root) + /// @param decls top-level messages and enums declared in this file + public record ProtoFile(String protoPackage, String javaPackage, List imports, List decls) { + } + + /// Top-level declaration: either a message or an enum. + public sealed interface TopDecl permits MessageDecl, EnumDecl { + } + + /// A {@code message Foo { ... }} declaration. + /// + /// @param name simple name (not qualified) + /// @param members fields, oneofs, nested messages, nested enums + public record MessageDecl(String name, List members) implements TopDecl, MessageMember { + } + + /// A member of a {@link MessageDecl}. + public sealed interface MessageMember permits FieldDecl, OneOfDecl, MessageDecl, EnumDecl { + } + + /// A single field declaration inside a message or oneof. + /// + /// @param rule singular / optional / repeated + /// @param type field type (scalar or ref) + /// @param name field name as written in the {@code .proto} + /// @param number field tag number + /// @param packed whether a repeated field has explicit {@code [packed=...]} option ({@code Optional.empty()} = default) + public record FieldDecl(Rule rule, FieldType type, String name, int number, Optional packed) implements MessageMember { + } + + /// A {@code oneof name { ... }} block. Member fields share a discriminator on the wire. + /// + /// @param name oneof name + /// @param fields oneof member fields + public record OneOfDecl(String name, List fields) implements MessageMember { + } + + /// An {@code enum Foo { ... }} declaration. + /// + /// @param name enum name + /// @param values enum values + public record EnumDecl(String name, List values) implements TopDecl, MessageMember { + } + + /// An entry of an enum block. + /// + /// @param name Java constant name + /// @param number wire value + public record EnumValue(String name, int number) { + } + + /// Field presence rule. + public enum Rule { SINGLE, OPTIONAL, REPEATED } + + /// Field type variants — either a built-in scalar or a reference to a user-declared message/enum. + public sealed interface FieldType permits Scalar, Ref { + } + + /// Built-in proto3 scalar field types used by vortex. + public enum Scalar implements FieldType { + UINT32, UINT64, SINT64, INT32, BOOL, FLOAT, DOUBLE, STRING, BYTES + } + + /// Reference to a user-declared type (message or enum). Resolved post-parse against all loaded files. + /// + /// @param typeName the textual type reference as written ({@code "PType"}, {@code "vortex.dtype.DType"}, etc.) + public record Ref(String typeName) implements FieldType { + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/CodeGen.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/CodeGen.java new file mode 100644 index 00000000..01b160c7 --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/CodeGen.java @@ -0,0 +1,701 @@ +package io.github.dfa1.vortex.protogen; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +/// Walks a {@link TypeRegistry} and emits one {@code .java} file per message or enum. +/// +/// Output: +/// - Each enum becomes a Java {@code enum} with bounds-checked {@code fromValue(int)}. +/// - Each message becomes an immutable Java {@code record} with a static +/// {@code decode(MemorySegment, long, long)} factory and an instance {@code encode()} method. +/// - All generated classes live in the same Java package, derived from the +/// {@code java_package} option of the first parsed file. +public final class CodeGen { + + /// Java reserved words + literals that cannot be used as identifiers. + /// Field/parameter names that collide get a trailing underscore. + private static final java.util.Set JAVA_RESERVED = java.util.Set.of( + "abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", + "class", "const", "continue", "default", "do", "double", "else", "enum", + "extends", "final", "finally", "float", "for", "goto", "if", "implements", + "import", "instanceof", "int", "interface", "long", "native", "new", "package", + "private", "protected", "public", "return", "short", "static", "strictfp", + "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", + "void", "volatile", "while", "true", "false", "null", "yield", "var", "record", + "sealed", "permits", "non-sealed"); + + static String safeName(String raw) { + return JAVA_RESERVED.contains(raw) ? raw + "_" : raw; + } + + private final TypeRegistry registry; + + /// @param registry resolved type registry + public CodeGen(TypeRegistry registry) { + this.registry = registry; + } + + /// Generates one Java source file per type into {@code outDir}. + /// + /// @param outDir output directory (created if absent) + /// @throws IOException on filesystem errors + public void emit(Path outDir) throws IOException { + Files.createDirectories(outDir); + for (TypeRegistry.ResolvedType t : registry.all()) { + String src = switch (t) { + case TypeRegistry.ResolvedType.Message m -> emitMessage(m); + case TypeRegistry.ResolvedType.Enum e -> emitEnum(e); + }; + Path target = outDir.resolve(t.javaName() + ".java"); + Files.writeString(target, src); + } + } + + private String emitEnum(TypeRegistry.ResolvedType.Enum e) { + StringBuilder sb = new StringBuilder(); + sb.append("package ").append(e.javaPackage()).append(";\n\n"); + sb.append("import javax.annotation.processing.Generated;\n\n"); + sb.append("/// Generated from proto3 enum {@code ").append(e.fqn()).append("}.\n"); + sb.append("/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}.\n"); + sb.append("@Generated(\"io.github.dfa1.vortex.protogen.CodeGen\")\n"); + sb.append("public enum ").append(e.javaName()).append(" {\n"); + List values = e.decl().values(); + for (int i = 0; i < values.size(); i++) { + Ast.EnumValue v = values.get(i); + sb.append(" ").append(v.name()).append("(").append(v.number()).append(")"); + sb.append(i == values.size() - 1 ? ";\n\n" : ",\n"); + } + sb.append(" private final int value;\n\n"); + sb.append(" ").append(e.javaName()).append("(int value) {\n"); + sb.append(" this.value = value;\n"); + sb.append(" }\n\n"); + sb.append(" /// @return the wire-format integer value\n"); + sb.append(" public int value() {\n"); + sb.append(" return value;\n"); + sb.append(" }\n\n"); + sb.append(" /// Resolves a wire-format integer back to its enum constant.\n"); + sb.append(" /// @param value wire-format integer\n"); + sb.append(" /// @return matching enum constant\n"); + sb.append(" /// @throws IllegalArgumentException if no constant matches\n"); + sb.append(" public static ").append(e.javaName()).append(" fromValue(int value) {\n"); + sb.append(" for (").append(e.javaName()).append(" v : values()) {\n"); + sb.append(" if (v.value == value) {\n"); + sb.append(" return v;\n"); + sb.append(" }\n"); + sb.append(" }\n"); + sb.append(" throw new IllegalArgumentException(\"unknown ").append(e.javaName()).append(" value: \" + value);\n"); + sb.append(" }\n"); + sb.append("}\n"); + return sb.toString(); + } + + private String emitMessage(TypeRegistry.ResolvedType.Message m) { + List fields = flattenFields(m.decl()); + boolean hasByteArrayField = fields.stream().anyMatch(f -> f.javaType.equals("byte[]")); + StringBuilder sb = new StringBuilder(); + sb.append("package ").append(m.javaPackage()).append(";\n\n"); + sb.append("import java.io.IOException;\n"); + sb.append("import java.lang.foreign.MemorySegment;\n"); + if (hasByteArrayField) { + sb.append("import java.util.Arrays;\n"); + } + sb.append("import javax.annotation.processing.Generated;\n\n"); + sb.append("/// Generated from proto3 message {@code ").append(m.fqn()).append("}.\n"); + sb.append("/// Do not edit by hand — regenerate via {@code ./mvnw generate-sources -pl core -P regenerate-sources}.\n"); + for (Field f : fields) { + sb.append("/// @param ").append(f.name).append(" field tag ").append(f.number).append("\n"); + } + sb.append("@Generated(\"io.github.dfa1.vortex.protogen.CodeGen\")\n"); + sb.append("public record ").append(m.javaName()).append("(\n"); + for (int i = 0; i < fields.size(); i++) { + Field f = fields.get(i); + sb.append(" ").append(f.javaType).append(" ").append(f.name); + sb.append(i == fields.size() - 1 ? "\n" : ",\n"); + } + if (fields.isEmpty()) { + // empty record + } + sb.append(") {\n\n"); + emitDecode(sb, m, fields); + sb.append("\n"); + emitEncode(sb, fields); + emitOneOfFactories(sb, m, fields); + if (hasByteArrayField) { + emitByteArrayEqualsHashCode(sb, m, fields); + } + sb.append("}\n"); + return sb.toString(); + } + + /// Records auto-generate equals/hashCode using {@code Objects.equals}, which falls back to + /// reference equality for {@code byte[]} components. Override with {@code Arrays.equals}/ + /// {@code Arrays.hashCode} so structurally equal records compare equal. + private void emitByteArrayEqualsHashCode(StringBuilder sb, TypeRegistry.ResolvedType.Message m, List fields) { + sb.append("\n @Override\n"); + sb.append(" public boolean equals(Object __o) {\n"); + sb.append(" if (this == __o) {\n"); + sb.append(" return true;\n"); + sb.append(" }\n"); + sb.append(" if (!(__o instanceof ").append(m.javaName()).append(" __that)) {\n"); + sb.append(" return false;\n"); + sb.append(" }\n"); + for (int i = 0; i < fields.size(); i++) { + Field f = fields.get(i); + String cmp = fieldEquals(f, "__that"); + sb.append(" ").append(i == 0 ? "return " : " && ").append(cmp); + sb.append(i == fields.size() - 1 ? ";\n" : "\n"); + } + if (fields.isEmpty()) { + sb.append(" return true;\n"); + } + sb.append(" }\n\n"); + sb.append(" @Override\n"); + sb.append(" public int hashCode() {\n"); + sb.append(" int __h = 1;\n"); + for (Field f : fields) { + sb.append(" __h = 31 * __h + ").append(fieldHash(f)).append(";\n"); + } + sb.append(" return __h;\n"); + sb.append(" }\n"); + } + + private static String fieldEquals(Field f, String other) { + if (f.javaType.equals("byte[]")) { + return "java.util.Arrays.equals(" + f.name + ", " + other + "." + f.name + ")"; + } + return switch (f.javaType) { + case "int", "long", "boolean", "float", "double" -> f.name + " == " + other + "." + f.name + "()"; + default -> "java.util.Objects.equals(" + f.name + ", " + other + "." + f.name + ")"; + }; + } + + private static String fieldHash(Field f) { + if (f.javaType.equals("byte[]")) { + return "java.util.Arrays.hashCode(" + f.name + ")"; + } + return switch (f.javaType) { + case "int", "boolean" -> "Integer.hashCode(" + (f.javaType.equals("boolean") ? "(" + f.name + " ? 1 : 0)" : f.name) + ")"; + case "long" -> "Long.hashCode(" + f.name + ")"; + case "float" -> "Float.hashCode(" + f.name + ")"; + case "double" -> "Double.hashCode(" + f.name + ")"; + default -> "java.util.Objects.hashCode(" + f.name + ")"; + }; + } + + /// Emits one static factory per oneof member, returning a record with that member set and all other components {@code null}. + /// Avoids verbose constructor calls at consumer sites (e.g. {@code ScalarValue.ofInt64Value(123L)} + /// instead of {@code new ScalarValue(null, null, 123L, null, null, null, null, null, null, null, null)}). + private void emitOneOfFactories(StringBuilder sb, TypeRegistry.ResolvedType.Message m, List fields) { + for (Ast.MessageMember mem : m.decl().members()) { + if (!(mem instanceof Ast.OneOfDecl oneOf)) { + continue; + } + for (Ast.FieldDecl decl : oneOf.fields()) { + String safeFieldName = safeName(decl.name()); + int pos = -1; + for (int i = 0; i < fields.size(); i++) { + if (fields.get(i).name.equals(safeFieldName)) { + pos = i; + break; + } + } + if (pos < 0) { + continue; + } + Field target = fields.get(pos); + String factoryName = "of" + pascalCase(decl.name()); + sb.append("\n /// Factory for oneof case {@code ").append(decl.name()).append("} (field tag ").append(decl.number()).append(").\n"); + sb.append(" /// @param value the value to set\n"); + sb.append(" /// @return a record with only the {@code ").append(decl.name()).append("} component set\n"); + sb.append(" public static ").append(m.javaName()).append(" ").append(factoryName) + .append("(").append(target.javaType).append(" value) {\n"); + sb.append(" return new ").append(m.javaName()).append("("); + for (int i = 0; i < fields.size(); i++) { + sb.append(i == pos ? "value" : "null"); + if (i < fields.size() - 1) { + sb.append(", "); + } + } + sb.append(");\n"); + sb.append(" }\n"); + } + } + } + + private static String pascalCase(String snake) { + StringBuilder out = new StringBuilder(snake.length()); + boolean upper = true; + for (int i = 0; i < snake.length(); i++) { + char c = snake.charAt(i); + if (c == '_') { + upper = true; + } else if (upper) { + out.append(Character.toUpperCase(c)); + upper = false; + } else { + out.append(c); + } + } + return out.toString(); + } + + private void emitDecode(StringBuilder sb, TypeRegistry.ResolvedType.Message m, List fields) { + sb.append(" /// Decodes a {@code ").append(m.fqn()).append("} from a slice of a memory segment.\n"); + sb.append(" /// @param __seg backing segment\n"); + sb.append(" /// @param __off start offset in bytes\n"); + sb.append(" /// @param __len payload length in bytes\n"); + sb.append(" /// @return decoded record\n"); + sb.append(" /// @throws IOException if the slice is malformed or truncated\n"); + sb.append(" public static ").append(m.javaName()).append(" decode(MemorySegment __seg, long __off, long __len) throws IOException {\n"); + sb.append(" ProtoReader r = new ProtoReader(__seg, __off, __len);\n"); + for (Field f : fields) { + sb.append(" ").append(f.javaType).append(" ").append(f.name).append(" = ").append(f.initExpr).append(";\n"); + } + sb.append(" while (r.hasMore()) {\n"); + sb.append(" int tag = r.readVarint32();\n"); + sb.append(" switch (tag >>> 3) {\n"); + for (Field f : fields) { + sb.append(" case ").append(f.number).append(" -> {\n"); + f.emitDecode(sb, " "); + sb.append(" }\n"); + } + sb.append(" default -> r.skipField(tag & 7);\n"); + sb.append(" }\n"); + sb.append(" }\n"); + sb.append(" return new ").append(m.javaName()).append("("); + for (int i = 0; i < fields.size(); i++) { + sb.append(fields.get(i).name); + if (i < fields.size() - 1) { + sb.append(", "); + } + } + sb.append(");\n"); + sb.append(" }\n"); + } + + private void emitEncode(StringBuilder sb, List fields) { + sb.append(" /// Encodes this record to a proto3-wire-format byte array.\n"); + sb.append(" /// @return encoded bytes\n"); + sb.append(" public byte[] encode() {\n"); + sb.append(" ProtoWriter w = new ProtoWriter();\n"); + for (Field f : fields) { + f.emitEncode(sb, " "); + } + sb.append(" return w.toByteArray();\n"); + sb.append(" }\n"); + } + + /// Flattens a message's members (including oneof fields) into a single field list. + /// Nested messages and enums are emitted separately via the registry walk. + private List flattenFields(Ast.MessageDecl msg) { + List out = new ArrayList<>(); + for (Ast.MessageMember mem : msg.members()) { + switch (mem) { + case Ast.FieldDecl f -> out.add(toField(f)); + case Ast.OneOfDecl o -> { + for (Ast.FieldDecl f : o.fields()) { + // OneOf members are always presence-tracked → treat as OPTIONAL. + out.add(toField(new Ast.FieldDecl(Ast.Rule.OPTIONAL, f.type(), f.name(), f.number(), f.packed()))); + } + } + case Ast.MessageDecl ignored -> { /* nested, emitted separately */ } + case Ast.EnumDecl ignored -> { /* nested, emitted separately */ } + } + } + return out; + } + + private Field toField(Ast.FieldDecl decl) { + return Field.from(decl, registry); + } + + /// Internal per-field model used by the emitter. Encapsulates Java type, init value, + /// and emit logic for both decode and encode paths. + private static final class Field { + final String name; + final int number; + final String javaType; + final String initExpr; + private final Emitter emitter; + + private Field(String name, int number, String javaType, String initExpr, Emitter emitter) { + this.name = name; + this.number = number; + this.javaType = javaType; + this.initExpr = initExpr; + this.emitter = emitter; + } + + void emitDecode(StringBuilder sb, String indent) { + emitter.emitDecode(sb, indent, this); + } + + void emitEncode(StringBuilder sb, String indent) { + emitter.emitEncode(sb, indent, this); + } + + static Field from(Ast.FieldDecl decl, TypeRegistry reg) { + return switch (decl.type()) { + case Ast.Scalar s -> ofScalar(decl, s); + case Ast.Ref ref -> ofRef(decl, ref, reg); + }; + } + + private static Field ofScalar(Ast.FieldDecl decl, Ast.Scalar s) { + String prim = switch (s) { + case UINT32, INT32 -> "int"; + case UINT64, SINT64 -> "long"; + case BOOL -> "boolean"; + case FLOAT -> "float"; + case DOUBLE -> "double"; + case STRING -> "String"; + case BYTES -> "byte[]"; + }; + String boxed = switch (s) { + case UINT32, INT32 -> "Integer"; + case UINT64, SINT64 -> "Long"; + case BOOL -> "Boolean"; + case FLOAT -> "Float"; + case DOUBLE -> "Double"; + case STRING -> "String"; + case BYTES -> "byte[]"; + }; + String name = safeName(decl.name()); + return switch (decl.rule()) { + case SINGLE -> new Field(name, decl.number(), prim, defaultPrim(s), + new ScalarSingleEmitter(s)); + case OPTIONAL -> new Field(name, decl.number(), boxed, "null", + new ScalarOptionalEmitter(s)); + case REPEATED -> new Field(name, decl.number(), "java.util.List<" + boxed + ">", "new java.util.ArrayList<>()", + new ScalarRepeatedEmitter(s)); + }; + } + + private static Field ofRef(Ast.FieldDecl decl, Ast.Ref ref, TypeRegistry reg) { + TypeRegistry.ResolvedType t = reg.resolve(ref, ""); + String javaName = t.javaName(); + String name = safeName(decl.name()); + return switch (t) { + case TypeRegistry.ResolvedType.Enum e -> switch (decl.rule()) { + case SINGLE -> new Field(name, decl.number(), javaName, + javaName + "." + e.decl().values().get(0).name(), + new EnumSingleEmitter(javaName)); + case OPTIONAL -> new Field(name, decl.number(), javaName, "null", + new EnumOptionalEmitter(javaName)); + case REPEATED -> new Field(name, decl.number(), "java.util.List<" + javaName + ">", + "new java.util.ArrayList<>()", new EnumRepeatedEmitter(javaName)); + }; + case TypeRegistry.ResolvedType.Message msg -> switch (decl.rule()) { + // Singular and Optional message refs are both nullable (proto3 message presence semantics). + case SINGLE, OPTIONAL -> new Field(name, decl.number(), javaName, "null", + new MessageOptionalEmitter(javaName)); + case REPEATED -> new Field(name, decl.number(), "java.util.List<" + javaName + ">", + "new java.util.ArrayList<>()", new MessageRepeatedEmitter(javaName)); + }; + }; + } + + private static String defaultPrim(Ast.Scalar s) { + return switch (s) { + case BOOL -> "false"; + case STRING -> "\"\""; + case BYTES -> "new byte[0]"; + case FLOAT -> "0f"; + case DOUBLE -> "0d"; + default -> "0"; + }; + } + } + + private interface Emitter { + void emitDecode(StringBuilder sb, String indent, Field f); + + void emitEncode(StringBuilder sb, String indent, Field f); + } + + // ------------------------------------------------------------------ + // Scalar emitters + // ------------------------------------------------------------------ + + private static String readExpr(Ast.Scalar s) { + return switch (s) { + case UINT32, INT32 -> "r.readVarint32()"; + case UINT64 -> "r.readVarint64()"; + case SINT64 -> "r.readSint64()"; + case BOOL -> "r.readBool()"; + case FLOAT -> "r.readFloat()"; + case DOUBLE -> "r.readDouble()"; + case STRING -> "r.readString()"; + case BYTES -> "r.readBytes()"; + }; + } + + private static int wireType(Ast.Scalar s) { + return switch (s) { + case UINT32, UINT64, SINT64, INT32, BOOL -> 0; + case FLOAT -> 5; + case DOUBLE -> 1; + case STRING, BYTES -> 2; + }; + } + + private static String writeStmt(Ast.Scalar s, String value) { + return switch (s) { + case UINT32, INT32 -> "w.writeVarint32(" + value + ");"; + case UINT64 -> "w.writeVarint64(" + value + ");"; + case SINT64 -> "w.writeSint64(" + value + ");"; + case BOOL -> "w.writeBool(" + value + ");"; + case FLOAT -> "w.writeFloat(" + value + ");"; + case DOUBLE -> "w.writeDouble(" + value + ");"; + case STRING -> "w.writeString(" + value + ");"; + case BYTES -> "w.writeBytes(" + value + ");"; + }; + } + + private static String defaultCheckNonZero(Ast.Scalar s, String var) { + return switch (s) { + case BOOL -> var; + case STRING -> var + " != null && !" + var + ".isEmpty()"; + case BYTES -> var + " != null && " + var + ".length != 0"; + case FLOAT -> "Float.floatToRawIntBits(" + var + ") != 0"; + case DOUBLE -> "Double.doubleToRawLongBits(" + var + ") != 0L"; + case UINT32, INT32 -> var + " != 0"; + case UINT64, SINT64 -> var + " != 0L"; + }; + } + + private record ScalarSingleEmitter(Ast.Scalar s) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append(f.name).append(" = ").append(readExpr(s)).append(";\n"); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (").append(defaultCheckNonZero(s, f.name)).append(") {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", ").append(wireType(s)).append(");\n"); + sb.append(indent).append(" ").append(writeStmt(s, f.name)).append("\n"); + sb.append(indent).append("}\n"); + } + } + + private record ScalarOptionalEmitter(Ast.Scalar s) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append(f.name).append(" = ").append(readExpr(s)).append(";\n"); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (").append(f.name).append(" != null) {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", ").append(wireType(s)).append(");\n"); + sb.append(indent).append(" ").append(writeStmt(s, f.name)).append("\n"); + sb.append(indent).append("}\n"); + } + } + + private record ScalarRepeatedEmitter(Ast.Scalar s) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + int wt = wireType(s); + // Packed primitives may arrive as either LEN-wrapped packed or unpacked tag-per-element. + if (wt != 2) { + sb.append(indent).append("int wt = tag & 7;\n"); + sb.append(indent).append("if (wt == 2) {\n"); + sb.append(indent).append(" int len = r.readVarint32();\n"); + sb.append(indent).append(" java.util.List<").append(boxedName(s)).append("> __target = ").append(f.name).append(";\n"); + sb.append(indent).append(" r.readPacked(len, reader -> __target.add(").append(readExprOnReader(s, "reader")).append("));\n"); + sb.append(indent).append("} else {\n"); + sb.append(indent).append(" ").append(f.name).append(".add(").append(readExpr(s)).append(");\n"); + sb.append(indent).append("}\n"); + } else { + sb.append(indent).append(f.name).append(".add(").append(readExpr(s)).append(");\n"); + } + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + int wt = wireType(s); + if (wt != 2) { + // Pack primitives into a single LEN region. + sb.append(indent).append("if (!").append(f.name).append(".isEmpty()) {\n"); + sb.append(indent).append(" ProtoWriter packed = new ProtoWriter();\n"); + sb.append(indent).append(" for (").append(boxedName(s)).append(" __v : ").append(f.name).append(") {\n"); + sb.append(indent).append(" ").append(writeStmtOnWriter(s, "packed", "__v")).append("\n"); + sb.append(indent).append(" }\n"); + sb.append(indent).append(" byte[] __bytes = packed.toByteArray();\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 2);\n"); + sb.append(indent).append(" w.writeEmbedded(__bytes);\n"); + sb.append(indent).append("}\n"); + } else { + // LEN-type repeated: tag-per-element. + sb.append(indent).append("for (").append(boxedName(s)).append(" __v : ").append(f.name).append(") {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 2);\n"); + sb.append(indent).append(" ").append(writeStmt(s, "__v")).append("\n"); + sb.append(indent).append("}\n"); + } + } + } + + private static String boxedName(Ast.Scalar s) { + return switch (s) { + case UINT32, INT32 -> "Integer"; + case UINT64, SINT64 -> "Long"; + case BOOL -> "Boolean"; + case FLOAT -> "Float"; + case DOUBLE -> "Double"; + case STRING -> "String"; + case BYTES -> "byte[]"; + }; + } + + private static String readExprOnReader(Ast.Scalar s, String reader) { + return switch (s) { + case UINT32, INT32 -> reader + ".readVarint32()"; + case UINT64 -> reader + ".readVarint64()"; + case SINT64 -> reader + ".readSint64()"; + case BOOL -> reader + ".readBool()"; + case FLOAT -> reader + ".readFloat()"; + case DOUBLE -> reader + ".readDouble()"; + case STRING -> reader + ".readString()"; + case BYTES -> reader + ".readBytes()"; + }; + } + + private static String writeStmtOnWriter(Ast.Scalar s, String writer, String value) { + return switch (s) { + case UINT32, INT32 -> writer + ".writeVarint32(" + value + ");"; + case UINT64 -> writer + ".writeVarint64(" + value + ");"; + case SINT64 -> writer + ".writeSint64(" + value + ");"; + case BOOL -> writer + ".writeBool(" + value + ");"; + case FLOAT -> writer + ".writeFloat(" + value + ");"; + case DOUBLE -> writer + ".writeDouble(" + value + ");"; + case STRING -> writer + ".writeString(" + value + ");"; + case BYTES -> writer + ".writeBytes(" + value + ");"; + }; + } + + // ------------------------------------------------------------------ + // Enum emitters (wire type = VARINT) + // ------------------------------------------------------------------ + + /// Emits a try/catch wrapper that translates {@link IllegalArgumentException} from + /// {@code Enum.fromValue(int)} into a checked {@link IOException}. The caller must already be + /// inside a {@code throws IOException} context (every {@code decode(...)} factory is). + private static void emitEnumDecodeWrap(StringBuilder sb, String indent, String javaName, String assignTarget) { + sb.append(indent).append("int __ev = r.readVarint32();\n"); + sb.append(indent).append("try {\n"); + sb.append(indent).append(" ").append(assignTarget).append(" = ").append(javaName).append(".fromValue(__ev);\n"); + sb.append(indent).append("} catch (IllegalArgumentException __iae) {\n"); + sb.append(indent).append(" throw new IOException(\"unknown ").append(javaName).append(" value: \" + __ev);\n"); + sb.append(indent).append("}\n"); + } + + private record EnumSingleEmitter(String javaName) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + emitEnumDecodeWrap(sb, indent, javaName, f.name); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (").append(f.name).append(".value() != 0) {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 0);\n"); + sb.append(indent).append(" w.writeVarint32(").append(f.name).append(".value());\n"); + sb.append(indent).append("}\n"); + } + } + + private record EnumOptionalEmitter(String javaName) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + emitEnumDecodeWrap(sb, indent, javaName, f.name); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (").append(f.name).append(" != null) {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 0);\n"); + sb.append(indent).append(" w.writeVarint32(").append(f.name).append(".value());\n"); + sb.append(indent).append("}\n"); + } + } + + private record EnumRepeatedEmitter(String javaName) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("int wt = tag & 7;\n"); + sb.append(indent).append("if (wt == 2) {\n"); + sb.append(indent).append(" int len = r.readVarint32();\n"); + sb.append(indent).append(" java.util.List<").append(javaName).append("> __target = ").append(f.name).append(";\n"); + sb.append(indent).append(" r.readPacked(len, reader -> {\n"); + sb.append(indent).append(" int __ev = reader.readVarint32();\n"); + sb.append(indent).append(" try {\n"); + sb.append(indent).append(" __target.add(").append(javaName).append(".fromValue(__ev));\n"); + sb.append(indent).append(" } catch (IllegalArgumentException __iae) {\n"); + sb.append(indent).append(" throw new IOException(\"unknown ").append(javaName).append(" value: \" + __ev);\n"); + sb.append(indent).append(" }\n"); + sb.append(indent).append(" });\n"); + sb.append(indent).append("} else {\n"); + sb.append(indent).append(" int __ev2 = r.readVarint32();\n"); + sb.append(indent).append(" try {\n"); + sb.append(indent).append(" ").append(f.name).append(".add(").append(javaName).append(".fromValue(__ev2));\n"); + sb.append(indent).append(" } catch (IllegalArgumentException __iae) {\n"); + sb.append(indent).append(" throw new IOException(\"unknown ").append(javaName).append(" value: \" + __ev2);\n"); + sb.append(indent).append(" }\n"); + sb.append(indent).append("}\n"); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (!").append(f.name).append(".isEmpty()) {\n"); + sb.append(indent).append(" ProtoWriter packed = new ProtoWriter();\n"); + sb.append(indent).append(" for (").append(javaName).append(" __v : ").append(f.name).append(") {\n"); + sb.append(indent).append(" packed.writeVarint32(__v.value());\n"); + sb.append(indent).append(" }\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 2);\n"); + sb.append(indent).append(" w.writeEmbedded(packed.toByteArray());\n"); + sb.append(indent).append("}\n"); + } + } + + // ------------------------------------------------------------------ + // Message emitters (wire type = LEN; nested message decode + encode) + // ------------------------------------------------------------------ + + private record MessageOptionalEmitter(String javaName) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("MemorySegment __slice = r.readLenDelimSegment();\n"); + sb.append(indent).append(f.name).append(" = ").append(javaName).append(".decode(__slice, 0, __slice.byteSize());\n"); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("if (").append(f.name).append(" != null) {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 2);\n"); + sb.append(indent).append(" w.writeEmbedded(").append(f.name).append(".encode());\n"); + sb.append(indent).append("}\n"); + } + } + + private record MessageRepeatedEmitter(String javaName) implements Emitter { + @Override + public void emitDecode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("MemorySegment __slice = r.readLenDelimSegment();\n"); + sb.append(indent).append(f.name).append(".add(").append(javaName).append(".decode(__slice, 0, __slice.byteSize()));\n"); + } + + @Override + public void emitEncode(StringBuilder sb, String indent, Field f) { + sb.append(indent).append("for (").append(javaName).append(" __v : ").append(f.name).append(") {\n"); + sb.append(indent).append(" w.writeTag(").append(f.number).append(", 2);\n"); + sb.append(indent).append(" w.writeEmbedded(__v.encode());\n"); + sb.append(indent).append("}\n"); + } + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Lexer.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Lexer.java new file mode 100644 index 00000000..e103a396 --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Lexer.java @@ -0,0 +1,148 @@ +package io.github.dfa1.vortex.protogen; + +import java.util.ArrayList; +import java.util.List; + +/// Tokenizes a proto3 source file into a list of {@link Token}s. +/// Comments ({@code //} line, {@code /* ... */} block) and whitespace are dropped. +public final class Lexer { + + private final String src; + private int pos; + private int line; + + /// @param src raw {@code .proto} source text + public Lexer(String src) { + this.src = src; + this.pos = 0; + this.line = 1; + } + + /// Lex the entire source and return the token stream, terminated by a single {@code EOF}. + /// @return immutable token list + public List tokenize() { + List out = new ArrayList<>(); + while (true) { + skipWhitespaceAndComments(); + if (pos >= src.length()) { + out.add(new Token(Token.Kind.EOF, "", line)); + return List.copyOf(out); + } + char c = src.charAt(pos); + if (isIdentStart(c)) { + out.add(readIdent()); + } else if (Character.isDigit(c)) { + out.add(readNumber()); + } else if (c == '"') { + out.add(readString()); + } else { + out.add(readPunct()); + } + } + } + + private Token readIdent() { + int start = pos; + while (pos < src.length() && isIdentPart(src.charAt(pos))) { + pos++; + } + return new Token(Token.Kind.IDENT, src.substring(start, pos), line); + } + + private Token readNumber() { + int start = pos; + while (pos < src.length() && Character.isDigit(src.charAt(pos))) { + pos++; + } + return new Token(Token.Kind.INT_LITERAL, src.substring(start, pos), line); + } + + private Token readString() { + int startLine = line; + pos++; // skip opening " + StringBuilder sb = new StringBuilder(); + while (pos < src.length() && src.charAt(pos) != '"') { + char c = src.charAt(pos++); + if (c == '\\' && pos < src.length()) { + char esc = src.charAt(pos++); + sb.append(switch (esc) { + case 'n' -> '\n'; + case 't' -> '\t'; + case 'r' -> '\r'; + case '"' -> '"'; + case '\\' -> '\\'; + default -> esc; + }); + } else { + if (c == '\n') { + line++; + } + sb.append(c); + } + } + if (pos >= src.length()) { + throw new ProtoParseException("unterminated string at line " + startLine); + } + pos++; // skip closing " + return new Token(Token.Kind.STRING_LITERAL, sb.toString(), startLine); + } + + private Token readPunct() { + char c = src.charAt(pos++); + Token.Kind kind = switch (c) { + case '{' -> Token.Kind.LBRACE; + case '}' -> Token.Kind.RBRACE; + case '(' -> Token.Kind.LPAREN; + case ')' -> Token.Kind.RPAREN; + case '[' -> Token.Kind.LBRACKET; + case ']' -> Token.Kind.RBRACKET; + case '<' -> Token.Kind.LT; + case '>' -> Token.Kind.GT; + case ';' -> Token.Kind.SEMICOLON; + case ',' -> Token.Kind.COMMA; + case '=' -> Token.Kind.EQUALS; + case '.' -> Token.Kind.DOT; + default -> throw new ProtoParseException("unexpected character '" + c + "' at line " + line); + }; + return new Token(kind, String.valueOf(c), line); + } + + private void skipWhitespaceAndComments() { + while (pos < src.length()) { + char c = src.charAt(pos); + if (c == '\n') { + line++; + pos++; + } else if (Character.isWhitespace(c)) { + pos++; + } else if (c == '/' && pos + 1 < src.length() && src.charAt(pos + 1) == '/') { + pos += 2; + while (pos < src.length() && src.charAt(pos) != '\n') { + pos++; + } + } else if (c == '/' && pos + 1 < src.length() && src.charAt(pos + 1) == '*') { + pos += 2; + while (pos + 1 < src.length() && !(src.charAt(pos) == '*' && src.charAt(pos + 1) == '/')) { + if (src.charAt(pos) == '\n') { + line++; + } + pos++; + } + if (pos + 1 >= src.length()) { + throw new ProtoParseException("unterminated block comment"); + } + pos += 2; + } else { + return; + } + } + } + + private static boolean isIdentStart(char c) { + return Character.isLetter(c) || c == '_'; + } + + private static boolean isIdentPart(char c) { + return Character.isLetterOrDigit(c) || c == '_'; + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Main.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Main.java new file mode 100644 index 00000000..89c41b5a --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Main.java @@ -0,0 +1,47 @@ +package io.github.dfa1.vortex.protogen; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +/// CLI entry for the build-time {@code .proto} to Java code generator. +/// Invoked from the {@code regenerate-sources} Maven profile via {@code exec-maven-plugin}. +public final class Main { + + private Main() { + } + + /// Usage: {@code Main --out [ ...]}. + /// @param args command-line arguments + /// @throws IOException on filesystem errors + public static void main(String[] args) throws IOException { + Path out = null; + List protos = new ArrayList<>(); + for (int i = 0; i < args.length; i++) { + if ("--out".equals(args[i])) { + if (i + 1 >= args.length) { + System.err.println("usage: protogen --out [ ...]"); + System.exit(2); + return; + } + out = Path.of(args[++i]); + } else { + protos.add(Path.of(args[i])); + } + } + if (out == null || protos.isEmpty()) { + System.err.println("usage: protogen --out [ ...]"); + System.exit(2); + return; + } + List files = new ArrayList<>(protos.size()); + for (Path p : protos) { + String src = Files.readString(p); + files.add(new Parser(new Lexer(src).tokenize()).parseFile()); + } + new CodeGen(new TypeRegistry(files)).emit(out); + System.out.println("protogen: wrote " + protos.size() + " .proto file(s) to " + out); + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Parser.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Parser.java new file mode 100644 index 00000000..6031ed6c --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Parser.java @@ -0,0 +1,270 @@ +package io.github.dfa1.vortex.protogen; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/// Recursive-descent parser for the proto3 subset used by vortex. +/// Accepts: {@code syntax}, {@code package}, {@code import}, {@code option} (only {@code java_package}), +/// {@code message}, {@code enum}, {@code oneof}, {@code repeated}, {@code optional}, and the proto3 scalar types +/// {@code uint32}, {@code uint64}, {@code sint64}, {@code int32}, {@code bool}, {@code float}, {@code double}, +/// {@code string}, {@code bytes}, plus user-declared message/enum refs. +/// Rejects: {@code service}, {@code rpc}, {@code extend}, {@code reserved}, {@code map<,>}, {@code editions}, custom options. +public final class Parser { + + private final List tokens; + private int pos; + + /// @param tokens token stream produced by {@link Lexer} + public Parser(List tokens) { + this.tokens = tokens; + this.pos = 0; + } + + /// Parses one {@code .proto} file. + /// @return the parsed file AST + public Ast.ProtoFile parseFile() { + String protoPackage = ""; + String javaPackage = ""; + List imports = new ArrayList<>(); + List decls = new ArrayList<>(); + + // syntax = "proto3"; — required + expectIdent("syntax"); + expect(Token.Kind.EQUALS); + Token syn = expect(Token.Kind.STRING_LITERAL); + if (!"proto3".equals(syn.text())) { + throw new ProtoParseException("only proto3 is supported, got '" + syn.text() + "' at line " + syn.line()); + } + expect(Token.Kind.SEMICOLON); + + while (peek().kind() != Token.Kind.EOF) { + Token t = peek(); + if (t.kind() == Token.Kind.IDENT) { + switch (t.text()) { + case "package" -> protoPackage = parsePackage(); + case "import" -> imports.add(parseImport()); + case "option" -> { + OptionEntry opt = parseOption(); + if ("java_package".equals(opt.name())) { + javaPackage = opt.value(); + } + } + case "message" -> decls.add(parseMessage()); + case "enum" -> decls.add(parseEnum()); + default -> throw new ProtoParseException("unexpected top-level token '" + t.text() + "' at line " + t.line()); + } + } else { + throw new ProtoParseException("expected top-level declaration at line " + t.line() + ", got " + t.kind()); + } + } + return new Ast.ProtoFile(protoPackage, javaPackage, List.copyOf(imports), List.copyOf(decls)); + } + + private String parsePackage() { + expectIdent("package"); + StringBuilder sb = new StringBuilder(expect(Token.Kind.IDENT).text()); + while (peek().kind() == Token.Kind.DOT) { + advance(); + sb.append('.').append(expect(Token.Kind.IDENT).text()); + } + expect(Token.Kind.SEMICOLON); + return sb.toString(); + } + + private String parseImport() { + expectIdent("import"); + Token path = expect(Token.Kind.STRING_LITERAL); + expect(Token.Kind.SEMICOLON); + return path.text(); + } + + private OptionEntry parseOption() { + expectIdent("option"); + String name = expect(Token.Kind.IDENT).text(); + while (peek().kind() == Token.Kind.DOT) { + advance(); + name += "." + expect(Token.Kind.IDENT).text(); + } + expect(Token.Kind.EQUALS); + String value; + Token v = peek(); + if (v.kind() == Token.Kind.STRING_LITERAL) { + value = advance().text(); + } else if (v.kind() == Token.Kind.IDENT || v.kind() == Token.Kind.INT_LITERAL) { + value = advance().text(); + } else { + throw new ProtoParseException("expected option value at line " + v.line()); + } + expect(Token.Kind.SEMICOLON); + return new OptionEntry(name, value); + } + + private Ast.MessageDecl parseMessage() { + expectIdent("message"); + String name = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.LBRACE); + List members = new ArrayList<>(); + while (peek().kind() != Token.Kind.RBRACE) { + Token t = peek(); + if (t.kind() != Token.Kind.IDENT) { + throw new ProtoParseException("expected message member at line " + t.line() + ", got " + t.kind()); + } + switch (t.text()) { + case "message" -> members.add(parseMessage()); + case "enum" -> members.add(parseEnum()); + case "oneof" -> members.add(parseOneOf()); + case "reserved" -> skipReserved(); + case "option" -> parseOption(); // ignored inside messages + default -> members.add(parseField()); + } + } + expect(Token.Kind.RBRACE); + return new Ast.MessageDecl(name, List.copyOf(members)); + } + + private Ast.OneOfDecl parseOneOf() { + expectIdent("oneof"); + String name = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.LBRACE); + List fields = new ArrayList<>(); + while (peek().kind() != Token.Kind.RBRACE) { + // oneof members are always SINGLE; no `optional` or `repeated` keyword. + fields.add(parseFieldBody(Ast.Rule.SINGLE)); + } + expect(Token.Kind.RBRACE); + return new Ast.OneOfDecl(name, List.copyOf(fields)); + } + + private Ast.FieldDecl parseField() { + Token first = peek(); + Ast.Rule rule = switch (first.text()) { + case "repeated" -> { + advance(); + yield Ast.Rule.REPEATED; + } + case "optional" -> { + advance(); + yield Ast.Rule.OPTIONAL; + } + default -> Ast.Rule.SINGLE; + }; + return parseFieldBody(rule); + } + + private Ast.FieldDecl parseFieldBody(Ast.Rule rule) { + Ast.FieldType type = parseFieldType(); + String name = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.EQUALS); + int number = Integer.parseInt(expect(Token.Kind.INT_LITERAL).text()); + Optional packed = Optional.empty(); + if (peek().kind() == Token.Kind.LBRACKET) { + advance(); + while (peek().kind() != Token.Kind.RBRACKET) { + String key = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.EQUALS); + String val = advance().text(); + if ("packed".equals(key)) { + packed = Optional.of(Boolean.parseBoolean(val)); + } + if (peek().kind() == Token.Kind.COMMA) { + advance(); + } + } + expect(Token.Kind.RBRACKET); + } + expect(Token.Kind.SEMICOLON); + return new Ast.FieldDecl(rule, type, name, number, packed); + } + + private Ast.FieldType parseFieldType() { + Token t = expect(Token.Kind.IDENT); + Ast.Scalar scalar = switch (t.text()) { + case "uint32" -> Ast.Scalar.UINT32; + case "uint64" -> Ast.Scalar.UINT64; + case "sint64" -> Ast.Scalar.SINT64; + case "int32" -> Ast.Scalar.INT32; + case "bool" -> Ast.Scalar.BOOL; + case "float" -> Ast.Scalar.FLOAT; + case "double" -> Ast.Scalar.DOUBLE; + case "string" -> Ast.Scalar.STRING; + case "bytes" -> Ast.Scalar.BYTES; + default -> null; + }; + if (scalar != null) { + return scalar; + } + // Qualified or unqualified type reference. + StringBuilder sb = new StringBuilder(t.text()); + while (peek().kind() == Token.Kind.DOT) { + advance(); + sb.append('.').append(expect(Token.Kind.IDENT).text()); + } + return new Ast.Ref(sb.toString()); + } + + private Ast.EnumDecl parseEnum() { + expectIdent("enum"); + String name = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.LBRACE); + List values = new ArrayList<>(); + while (peek().kind() != Token.Kind.RBRACE) { + Token t = peek(); + if (t.kind() == Token.Kind.IDENT && "option".equals(t.text())) { + parseOption(); + continue; + } + if (t.kind() == Token.Kind.IDENT && "reserved".equals(t.text())) { + skipReserved(); + continue; + } + String vn = expect(Token.Kind.IDENT).text(); + expect(Token.Kind.EQUALS); + int num = Integer.parseInt(expect(Token.Kind.INT_LITERAL).text()); + if (peek().kind() == Token.Kind.LBRACKET) { + while (advance().kind() != Token.Kind.RBRACKET) { + // discard enum value options + } + } + expect(Token.Kind.SEMICOLON); + values.add(new Ast.EnumValue(vn, num)); + } + expect(Token.Kind.RBRACE); + return new Ast.EnumDecl(name, List.copyOf(values)); + } + + private void skipReserved() { + // reserved [, ]* ; OR reserved "field"[, "field"]* ; + expectIdent("reserved"); + while (peek().kind() != Token.Kind.SEMICOLON) { + advance(); + } + expect(Token.Kind.SEMICOLON); + } + + private Token expect(Token.Kind kind) { + Token t = peek(); + if (t.kind() != kind) { + throw new ProtoParseException("expected " + kind + " at line " + t.line() + ", got " + t.kind() + " '" + t.text() + "'"); + } + return advance(); + } + + private void expectIdent(String text) { + Token t = expect(Token.Kind.IDENT); + if (!text.equals(t.text())) { + throw new ProtoParseException("expected '" + text + "' at line " + t.line() + ", got '" + t.text() + "'"); + } + } + + private Token peek() { + return tokens.get(pos); + } + + private Token advance() { + return tokens.get(pos++); + } + + private record OptionEntry(String name, String value) { + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/ProtoParseException.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/ProtoParseException.java new file mode 100644 index 00000000..583e1e83 --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/ProtoParseException.java @@ -0,0 +1,10 @@ +package io.github.dfa1.vortex.protogen; + +/// Thrown when {@code .proto} source is malformed or uses unsupported syntax. +public final class ProtoParseException extends RuntimeException { + + /// @param message diagnostic + public ProtoParseException(String message) { + super(message); + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Token.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Token.java new file mode 100644 index 00000000..f5e72355 --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/Token.java @@ -0,0 +1,29 @@ +package io.github.dfa1.vortex.protogen; + +/// A token emitted by {@link Lexer}. +/// +/// @param kind token kind +/// @param text source text — meaningful for {@link Kind#IDENT}, {@link Kind#INT_LITERAL}, {@link Kind#STRING_LITERAL} +/// @param line 1-based source line number for diagnostics +public record Token(Kind kind, String text, int line) { + + /// Token classification. + public enum Kind { + IDENT, + INT_LITERAL, + STRING_LITERAL, + LBRACE, + RBRACE, + LPAREN, + RPAREN, + LBRACKET, + RBRACKET, + LT, + GT, + SEMICOLON, + COMMA, + EQUALS, + DOT, + EOF + } +} diff --git a/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/TypeRegistry.java b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/TypeRegistry.java new file mode 100644 index 00000000..27fa3f7a --- /dev/null +++ b/proto-gen/src/main/java/io/github/dfa1/vortex/protogen/TypeRegistry.java @@ -0,0 +1,157 @@ +package io.github.dfa1.vortex.protogen; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/// Resolves type references across multiple parsed {@code .proto} files. +/// References to user-declared messages/enums may be written as short names ({@code PType}) +/// or as fully-qualified names ({@code vortex.dtype.PType}) — both must resolve to the same type. +public final class TypeRegistry { + + private final Map byFqn = new HashMap<>(); + + /// Builds a registry covering every message and enum across {@code files}. + /// Each top-level message gets registered under its qualified name {@code .} + /// (or just {@code } when the file has no package). + /// Nested messages and enums are registered under {@code .}. + /// + /// @param files parsed proto files + public TypeRegistry(List files) { + // Pre-seed google.protobuf.NullValue — only well-known type referenced by vortex schemas. + // Tracked under both its qualified FQN and its short name for unambiguous resolution. + String wellKnownJavaPkg = files.stream() + .map(Ast.ProtoFile::javaPackage) + .filter(s -> !s.isEmpty()) + .findFirst() + .orElse("io.github.dfa1.vortex.proto"); + Ast.EnumDecl nullValueDecl = new Ast.EnumDecl( + "NullValue", List.of(new Ast.EnumValue("NULL_VALUE", 0))); + ResolvedType.Enum nullValue = new ResolvedType.Enum(nullValueDecl, "google.protobuf.NullValue", wellKnownJavaPkg); + byFqn.put("google.protobuf.NullValue", nullValue); + + for (Ast.ProtoFile f : files) { + String pkgPrefix = f.protoPackage().isEmpty() ? "" : f.protoPackage() + "."; + for (Ast.TopDecl decl : f.decls()) { + indexTopDecl(decl, pkgPrefix, f.javaPackage()); + } + } + } + + private void indexTopDecl(Ast.TopDecl decl, String pkgPrefix, String javaPackage) { + switch (decl) { + case Ast.MessageDecl m -> { + String fqn = pkgPrefix + m.name(); + byFqn.put(fqn, new ResolvedType.Message(m, fqn, javaPackage)); + indexNested(m, fqn, javaPackage); + } + case Ast.EnumDecl e -> { + String fqn = pkgPrefix + e.name(); + byFqn.put(fqn, new ResolvedType.Enum(e, fqn, javaPackage)); + } + } + } + + private void indexNested(Ast.MessageDecl parent, String parentFqn, String javaPackage) { + for (Ast.MessageMember mem : parent.members()) { + switch (mem) { + case Ast.MessageDecl m -> { + String fqn = parentFqn + "." + m.name(); + byFqn.put(fqn, new ResolvedType.Message(m, fqn, javaPackage)); + indexNested(m, fqn, javaPackage); + } + case Ast.EnumDecl e -> { + String fqn = parentFqn + "." + e.name(); + byFqn.put(fqn, new ResolvedType.Enum(e, fqn, javaPackage)); + } + case Ast.FieldDecl ignored -> { } + case Ast.OneOfDecl ignored -> { } + } + } + } + + /// Resolves a textual {@link Ast.Ref#typeName()} to its concrete type, searching first + /// for an exact qualified match, then attempting to match under {@code searchPackage} + /// (the package of the file containing the reference). + /// + /// @param ref the reference to resolve + /// @param searchPackage package of the containing file (for unqualified lookups) + /// @return resolved type, never {@code null} + public ResolvedType resolve(Ast.Ref ref, String searchPackage) { + String name = ref.typeName(); + ResolvedType hit = byFqn.get(name); + if (hit != null) { + return hit; + } + if (!searchPackage.isEmpty()) { + hit = byFqn.get(searchPackage + "." + name); + if (hit != null) { + return hit; + } + } + // Suffix fallback: any FQN ending in ".". Multiple matches must error + // — otherwise resolution would silently depend on HashMap iteration order. + String suffix = "." + name; + List> matches = new ArrayList<>(); + for (Map.Entry e : byFqn.entrySet()) { + if (e.getKey().endsWith(suffix)) { + matches.add(e); + } + } + if (matches.size() == 1) { + return matches.get(0).getValue(); + } + if (matches.size() > 1) { + List fqns = new ArrayList<>(matches.size()); + for (Map.Entry e : matches) { + fqns.add(e.getKey()); + } + fqns.sort(String::compareTo); + throw new ProtoParseException("ambiguous type reference: '" + name + "' matches " + fqns); + } + throw new ProtoParseException("unresolved type reference: '" + name + "'"); + } + + /// Snapshot of all registered types, for the generator to iterate. + /// @return iterable of all entries + public Iterable all() { + return byFqn.values(); + } + + /// A resolved type — either a message or an enum — carrying enough context for code emission. + public sealed interface ResolvedType { + + /// @return Java package for the emitted class + String javaPackage(); + + /// @return Java simple class name + String javaName(); + + /// A resolved message type. + /// + /// @param decl AST node + /// @param fqn fully-qualified proto name + /// @param javaPackage Java package + record Message(Ast.MessageDecl decl, String fqn, String javaPackage) implements ResolvedType { + @Override + public String javaName() { + int dot = fqn.lastIndexOf('.'); + return dot >= 0 ? fqn.substring(dot + 1) : fqn; + } + } + + /// A resolved enum type. + /// + /// @param decl AST node + /// @param fqn fully-qualified proto name + /// @param javaPackage Java package + record Enum(Ast.EnumDecl decl, String fqn, String javaPackage) implements ResolvedType { + @Override + public String javaName() { + int dot = fqn.lastIndexOf('.'); + return dot >= 0 ? fqn.substring(dot + 1) : fqn; + } + } + } +} diff --git a/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/CodeGenTest.java b/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/CodeGenTest.java new file mode 100644 index 00000000..2939f1a0 --- /dev/null +++ b/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/CodeGenTest.java @@ -0,0 +1,67 @@ +package io.github.dfa1.vortex.protogen; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + +class CodeGenTest { + + @Test + void generatesJavaFromAllVortexProtos(@TempDir Path tmp) throws IOException { + // Given + Path root = repoRoot(); + List files = List.of( + parse(root.resolve("core/src/main/proto/dtype.proto")), + parse(root.resolve("core/src/main/proto/scalar.proto")), + parse(root.resolve("core/src/main/proto/encodings.proto")) + ); + CodeGen sut = new CodeGen(new TypeRegistry(files)); + + // When + sut.emit(tmp); + + // Then — a few expected files were emitted. + assertThat(Files.exists(tmp.resolve("PType.java"))).isTrue(); + assertThat(Files.exists(tmp.resolve("DType.java"))).isTrue(); + assertThat(Files.exists(tmp.resolve("ScalarValue.java"))).isTrue(); + assertThat(Files.exists(tmp.resolve("BitPackedMetadata.java"))).isTrue(); + assertThat(Files.exists(tmp.resolve("NullValue.java"))).isTrue(); + } + + @Test + void generatedBitPackedMetadataHasExpectedComponents(@TempDir Path tmp) throws IOException { + // Given + Path root = repoRoot(); + List files = List.of( + parse(root.resolve("core/src/main/proto/dtype.proto")), + parse(root.resolve("core/src/main/proto/encodings.proto")), + parse(root.resolve("core/src/main/proto/scalar.proto")) + ); + new CodeGen(new TypeRegistry(files)).emit(tmp); + + // When + String src = Files.readString(tmp.resolve("BitPackedMetadata.java")); + + // Then + assertThat(src).contains("public record BitPackedMetadata("); + assertThat(src).contains("int bit_width"); + assertThat(src).contains("int offset"); + assertThat(src).contains("PatchesMetadata patches"); + assertThat(src).contains("public static BitPackedMetadata decode(MemorySegment __seg, long __off, long __len)"); + assertThat(src).contains("public byte[] encode()"); + } + + private static Ast.ProtoFile parse(Path p) throws IOException { + return new Parser(new Lexer(Files.readString(p)).tokenize()).parseFile(); + } + + private static Path repoRoot() { + return Path.of("").toAbsolutePath().getParent(); + } +} diff --git a/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/ParserTest.java b/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/ParserTest.java new file mode 100644 index 00000000..ac6426e0 --- /dev/null +++ b/proto-gen/src/test/java/io/github/dfa1/vortex/protogen/ParserTest.java @@ -0,0 +1,175 @@ +package io.github.dfa1.vortex.protogen; + +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +class ParserTest { + + @Nested + class Synthetic { + + @Test + void parsesMinimalMessage() { + // Given + String src = """ + syntax = "proto3"; + package vortex.test; + option java_package = "io.github.dfa1.vortex.proto"; + message Foo { + uint32 bit_width = 1; + optional bytes meta = 2; + repeated string names = 3; + } + """; + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then + assertThat(sut.protoPackage()).isEqualTo("vortex.test"); + assertThat(sut.javaPackage()).isEqualTo("io.github.dfa1.vortex.proto"); + assertThat(sut.decls()).hasSize(1); + Ast.MessageDecl foo = (Ast.MessageDecl) sut.decls().get(0); + assertThat(foo.name()).isEqualTo("Foo"); + assertThat(foo.members()).hasSize(3); + Ast.FieldDecl f0 = (Ast.FieldDecl) foo.members().get(0); + assertThat(f0.name()).isEqualTo("bit_width"); + assertThat(f0.type()).isEqualTo(Ast.Scalar.UINT32); + assertThat(f0.rule()).isEqualTo(Ast.Rule.SINGLE); + assertThat(f0.number()).isEqualTo(1); + Ast.FieldDecl f1 = (Ast.FieldDecl) foo.members().get(1); + assertThat(f1.rule()).isEqualTo(Ast.Rule.OPTIONAL); + assertThat(f1.type()).isEqualTo(Ast.Scalar.BYTES); + Ast.FieldDecl f2 = (Ast.FieldDecl) foo.members().get(2); + assertThat(f2.rule()).isEqualTo(Ast.Rule.REPEATED); + assertThat(f2.type()).isEqualTo(Ast.Scalar.STRING); + } + + @Test + void parsesOneOf() { + // Given + String src = """ + syntax = "proto3"; + message Scalar { + oneof kind { + bool bool_value = 1; + sint64 int64_value = 2; + string string_value = 3; + } + } + """; + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then + Ast.MessageDecl msg = (Ast.MessageDecl) sut.decls().get(0); + Ast.OneOfDecl one = (Ast.OneOfDecl) msg.members().get(0); + assertThat(one.name()).isEqualTo("kind"); + assertThat(one.fields()).hasSize(3); + assertThat(one.fields().get(1).type()).isEqualTo(Ast.Scalar.SINT64); + } + + @Test + void parsesEnumAndQualifiedRef() { + // Given + String src = """ + syntax = "proto3"; + enum PType { U8 = 0; I64 = 7; } + message X { + vortex.dtype.PType ptype = 1; + } + """; + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then + Ast.EnumDecl e = (Ast.EnumDecl) sut.decls().get(0); + assertThat(e.values()).extracting(Ast.EnumValue::name).containsExactly("U8", "I64"); + assertThat(e.values()).extracting(Ast.EnumValue::number).containsExactly(0, 7); + Ast.MessageDecl m = (Ast.MessageDecl) sut.decls().get(1); + Ast.FieldDecl f = (Ast.FieldDecl) m.members().get(0); + assertThat(((Ast.Ref) f.type()).typeName()).isEqualTo("vortex.dtype.PType"); + } + + @Test + void rejectsProto2() { + // Given + String src = """ + syntax = "proto2"; + message Foo {} + """; + + // When + Then + assertThatThrownBy(() -> new Parser(new Lexer(src).tokenize()).parseFile()) + .isInstanceOf(ProtoParseException.class) + .hasMessageContaining("proto3"); + } + } + + @Nested + class VortexSources { + + @Test + void parsesDtypeProto() throws Exception { + // Given + String src = Files.readString(repoRoot().resolve("core/src/main/proto/dtype.proto")); + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then + assertThat(sut.protoPackage()).isEqualTo("vortex.dtype"); + assertThat(sut.javaPackage()).isEqualTo("io.github.dfa1.vortex.proto"); + assertThat(sut.decls()).extracting(d -> + switch (d) { + case Ast.MessageDecl m -> m.name(); + case Ast.EnumDecl e -> e.name(); + } + ).contains("DType", "PType", "Struct", "Extension", "FieldPath"); + } + + @Test + void parsesScalarProto() throws Exception { + // Given + String src = Files.readString(repoRoot().resolve("core/src/main/proto/scalar.proto")); + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then + assertThat(sut.imports()).contains("dtype.proto", "google/protobuf/struct.proto"); + assertThat(sut.decls()).extracting(d -> ((Ast.MessageDecl) d).name()) + .containsExactly("Scalar", "ScalarValue", "ListValue"); + } + + @Test + void parsesEncodingsProto() throws Exception { + // Given + String src = Files.readString(repoRoot().resolve("core/src/main/proto/encodings.proto")); + + // When + Ast.ProtoFile sut = new Parser(new Lexer(src).tokenize()).parseFile(); + + // Then — sanity-check the message count + a known field. + assertThat(sut.decls()).hasSizeGreaterThanOrEqualTo(15); + Ast.MessageDecl alp = (Ast.MessageDecl) sut.decls().stream() + .filter(d -> d instanceof Ast.MessageDecl m && m.name().equals("ALPMetadata")) + .findFirst().orElseThrow(); + assertThat(alp.members()).extracting(m -> ((Ast.FieldDecl) m).name()) + .containsExactly("exp_e", "exp_f", "patches"); + } + } + + private static Path repoRoot() { + // Test runs from proto-gen/, repo root is two levels up. + return Path.of("").toAbsolutePath().getParent(); + } +} diff --git a/reader/pom.xml b/reader/pom.xml index 4bc73565..f2faece3 100644 --- a/reader/pom.xml +++ b/reader/pom.xml @@ -24,10 +24,6 @@ com.google.flatbuffers flatbuffers-java - - com.google.protobuf - protobuf-java - org.junit.jupiter diff --git a/reader/src/test/java/io/github/dfa1/vortex/io/ZipBombSecurityTest.java b/reader/src/test/java/io/github/dfa1/vortex/io/ZipBombSecurityTest.java index 99304e87..16516ad8 100644 --- a/reader/src/test/java/io/github/dfa1/vortex/io/ZipBombSecurityTest.java +++ b/reader/src/test/java/io/github/dfa1/vortex/io/ZipBombSecurityTest.java @@ -18,10 +18,10 @@ import io.github.dfa1.vortex.fbs.Primitive; import io.github.dfa1.vortex.fbs.SegmentSpec; import io.github.dfa1.vortex.fbs.Type; -import io.github.dfa1.vortex.proto.ScalarProtos; import io.github.dfa1.vortex.scan.ScanOptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import io.github.dfa1.vortex.proto.ScalarValue; import java.io.OutputStream; import java.nio.ByteBuffer; @@ -114,8 +114,7 @@ void attack2_dictLayout_inflatedCodesRowCount(@TempDir Path tmp) throws Exceptio */ private static Path buildConstantBomb(Path dir, long claimedRows) throws Exception { // ConstantEncoding stores the scalar value in buffer 0 as protobuf bytes. - byte[] protoBytes = ScalarProtos.ScalarValue.newBuilder() - .setInt64Value(42L).build().toByteArray(); + byte[] protoBytes = ScalarValue.ofInt64Value(42L).encode(); byte[] seg = buildOneBufferSegment(protoBytes); ByteBuffer footerBuf = buildFooter( diff --git a/writer/pom.xml b/writer/pom.xml index 91f07a78..a96b858f 100644 --- a/writer/pom.xml +++ b/writer/pom.xml @@ -24,10 +24,6 @@ com.google.flatbuffers flatbuffers-java - - com.google.protobuf - protobuf-java - io.github.dfa1.vortex