mirror of
https://github.com/linuxserver/fleet.git
synced 2026-02-20 05:11:08 +08:00
Ensure TagDigest is comparable so Sets can adequately dedupe where necessary.
This commit is contained in:
parent
4aca22cf89
commit
cc32989d81
@ -9,7 +9,7 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
version = '2.1.1'
|
||||
version = '2.2.1'
|
||||
|
||||
sourceSets {
|
||||
|
||||
|
||||
@ -17,7 +17,9 @@
|
||||
|
||||
package io.linuxserver.fleet.v2.types;
|
||||
|
||||
public class TagDigest {
|
||||
import java.util.Objects;
|
||||
|
||||
public class TagDigest implements Comparable<TagDigest> {
|
||||
|
||||
private final long size;
|
||||
private final String digest;
|
||||
@ -47,4 +49,41 @@ public class TagDigest {
|
||||
public final String getArchVariant() {
|
||||
return archVariant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(digest, architecture, archVariant);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (null == obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof TagDigest)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final TagDigest other = (TagDigest) obj;
|
||||
|
||||
return Objects.equals(digest, other.digest) &&
|
||||
Objects.equals(architecture, other.architecture) &&
|
||||
Objects.equals(archVariant, other.archVariant);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DIGEST:" + digest + "--" + architecture + "/" + archVariant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(TagDigest o) {
|
||||
|
||||
if (null == o) {
|
||||
return 1;
|
||||
}
|
||||
return toString().compareTo(o.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#Sat Feb 13 14:18:23 GMT 2021
|
||||
app.build.date=2021-02-13T14\:18\:23
|
||||
#Sat Feb 13 16:35:07 GMT 2021
|
||||
app.build.date=2021-02-13T16\:35\:07
|
||||
app.build.os=Windows 10
|
||||
app.build.user=jagfi
|
||||
app.version=2.2.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user