diff options
Diffstat (limited to 'jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java')
-rw-r--r-- | jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java index 1b3cc0a..46470d4 100644 --- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java +++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DeltaFallback.java @@ -6,19 +6,31 @@ import java.nio.ByteOrder; /** * A fallback entry in a {@link DeltaSuperblock}. * + * <p>References a file in the OSTree repository. + * * <p>Reference: {@code ostree-repo-static-delta-private.h#OSTREE_STATIC_DELTA_FALLBACK_FORMAT} + * + * @param objectType the object type of the file represented by this fallback entry. + * @param checksum the checksum of the file represented by this fallback entry. + * @param compressedSize the compressed size of the file represented by this fallback entry. + * @param uncompressedSize the uncompressed size of the file represented by this fallback entry. */ public record DeltaFallback( - byte objectType, Checksum checksum, long compressedSize, long uncompressedSize) { + ObjectType objectType, Checksum checksum, long compressedSize, long uncompressedSize) { private static final Decoder<DeltaFallback> DECODER = Decoder.ofStructure( DeltaFallback.class, - Decoder.ofByte(), + Decoder.ofByte().map(ObjectType::valueOf), Checksum.decoder(), Decoder.ofLong().withByteOrder(ByteOrder.LITTLE_ENDIAN), // FIXME: non-canonical Decoder.ofLong().withByteOrder(ByteOrder.LITTLE_ENDIAN)); // FIXME: non-canonical + /** + * Acquires a {@link Decoder} for the enclosing type. + * + * @return a possibly shared {@link Decoder}. + */ public static Decoder<DeltaFallback> decoder() { return DECODER; } |