aboutsummaryrefslogtreecommitdiff
path: root/jgvariant-ostree/src/main/java/eu
diff options
context:
space:
mode:
Diffstat (limited to 'jgvariant-ostree/src/main/java/eu')
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Commit.java10
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DirTree.java11
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Metadata.java6
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SignedDelta.java5
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Summary.java5
-rw-r--r--jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SummarySignature.java6
6 files changed, 21 insertions, 22 deletions
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Commit.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Commit.java
index 209827d..f14e758 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Commit.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Commit.java
@@ -4,9 +4,10 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import eu.mulk.jgvariant.core.Decoder;
import java.nio.ByteOrder;
-import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@@ -48,8 +49,7 @@ public record Commit(
public record RelatedObject(String ref, Checksum commitChecksum) {
private static final Decoder<RelatedObject> DECODER =
- Decoder.ofStructure(
- RelatedObject.class, Decoder.ofString(StandardCharsets.UTF_8), Checksum.decoder());
+ Decoder.ofStructure(RelatedObject.class, Decoder.ofString(UTF_8), Checksum.decoder());
public static Decoder<RelatedObject> decoder() {
return DECODER;
@@ -62,8 +62,8 @@ public record Commit(
Metadata.decoder(),
Checksum.decoder(),
Decoder.ofArray(RelatedObject.decoder()),
- Decoder.ofString(StandardCharsets.UTF_8),
- Decoder.ofString(StandardCharsets.UTF_8),
+ Decoder.ofString(UTF_8),
+ Decoder.ofString(UTF_8),
Decoder.ofLong().withByteOrder(ByteOrder.BIG_ENDIAN),
Checksum.decoder(),
Checksum.decoder());
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DirTree.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DirTree.java
index dc38b1b..8ac9e67 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DirTree.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/DirTree.java
@@ -4,8 +4,9 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import eu.mulk.jgvariant.core.Decoder;
-import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@@ -34,8 +35,7 @@ public record DirTree(List<File> files, List<Directory> directories) {
public record File(String name, Checksum checksum) {
private static final Decoder<File> DECODER =
- Decoder.ofStructure(
- File.class, Decoder.ofString(StandardCharsets.UTF_8), Checksum.decoder());
+ Decoder.ofStructure(File.class, Decoder.ofString(UTF_8), Checksum.decoder());
/**
* Acquires a {@link Decoder} for the enclosing type.
@@ -58,10 +58,7 @@ public record DirTree(List<File> files, List<Directory> directories) {
private static final Decoder<Directory> DECODER =
Decoder.ofStructure(
- Directory.class,
- Decoder.ofString(StandardCharsets.UTF_8),
- Checksum.decoder(),
- Checksum.decoder());
+ Directory.class, Decoder.ofString(UTF_8), Checksum.decoder(), Checksum.decoder());
/**
* Acquires a {@link Decoder} for the enclosing type.
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Metadata.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Metadata.java
index 6e1f820..62f0331 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Metadata.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Metadata.java
@@ -4,9 +4,10 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import eu.mulk.jgvariant.core.Decoder;
import eu.mulk.jgvariant.core.Variant;
-import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
@@ -19,8 +20,7 @@ import java.util.Map;
public record Metadata(Map<String, Variant> fields) {
private static final Decoder<Metadata> DECODER =
- Decoder.ofDictionary(Decoder.ofString(StandardCharsets.UTF_8), Decoder.ofVariant())
- .map(Metadata::new);
+ Decoder.ofDictionary(Decoder.ofString(UTF_8), Decoder.ofVariant()).map(Metadata::new);
/**
* Acquires a {@link Decoder} for the enclosing type.
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SignedDelta.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SignedDelta.java
index e1fcd53..827d5e4 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SignedDelta.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SignedDelta.java
@@ -4,11 +4,12 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.US_ASCII;
+
import eu.mulk.jgvariant.core.Decoder;
import eu.mulk.jgvariant.core.Variant;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
@@ -31,7 +32,7 @@ public record SignedDelta(
SignedDelta.class,
Decoder.ofLong().withByteOrder(ByteOrder.BIG_ENDIAN),
ByteString.decoder().map(SignedDelta::decodeSuperblock),
- Decoder.ofDictionary(Decoder.ofString(StandardCharsets.US_ASCII), Decoder.ofVariant()));
+ Decoder.ofDictionary(Decoder.ofString(US_ASCII), Decoder.ofVariant()));
private static DeltaSuperblock decodeSuperblock(ByteString byteString) {
return DeltaSuperblock.decoder().decode(ByteBuffer.wrap(byteString.bytes()));
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Summary.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Summary.java
index 150ab00..2b8096d 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Summary.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/Summary.java
@@ -4,9 +4,10 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import eu.mulk.jgvariant.core.Decoder;
import java.nio.ByteOrder;
-import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@@ -58,7 +59,7 @@ public record Summary(List<Entry> entries, Metadata metadata) {
}
private static final Decoder<Entry> DECODER =
- Decoder.ofStructure(Entry.class, Decoder.ofString(StandardCharsets.UTF_8), Value.decoder());
+ Decoder.ofStructure(Entry.class, Decoder.ofString(UTF_8), Value.decoder());
/**
* Acquires a {@link Decoder} for the enclosing type.
diff --git a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SummarySignature.java b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SummarySignature.java
index c878955..3c88759 100644
--- a/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SummarySignature.java
+++ b/jgvariant-ostree/src/main/java/eu/mulk/jgvariant/ostree/SummarySignature.java
@@ -4,9 +4,10 @@
package eu.mulk.jgvariant.ostree;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import eu.mulk.jgvariant.core.Decoder;
import eu.mulk.jgvariant.core.Variant;
-import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
@@ -21,8 +22,7 @@ import java.util.Map;
public record SummarySignature(Map<String, Variant> signatures) {
private static final Decoder<SummarySignature> DECODER =
- Decoder.ofDictionary(Decoder.ofString(StandardCharsets.UTF_8), Decoder.ofVariant())
- .map(SummarySignature::new);
+ Decoder.ofDictionary(Decoder.ofString(UTF_8), Decoder.ofVariant()).map(SummarySignature::new);
/**
* Acquires a {@link Decoder} for the enclosing type.