diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-08-24 22:11:44 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-08-24 22:11:44 +0200 |
commit | 63cbe9b685a17483cdc88dbfe833fa1e14094843 (patch) | |
tree | d08218d2cf5cb67c08b84b5e32d35f87ac7aa3ba /archiva-modules/metadata/metadata-model | |
parent | ecec848cff05ca987e517c3fb8eef9a1e5f01121 (diff) | |
download | archiva-63cbe9b685a17483cdc88dbfe833fa1e14094843.tar.gz archiva-63cbe9b685a17483cdc88dbfe833fa1e14094843.zip |
Adding stream methods for artifact search
Diffstat (limited to 'archiva-modules/metadata/metadata-model')
-rw-r--r-- | archiva-modules/metadata/metadata-model/pom.xml | 4 | ||||
-rw-r--r-- | archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/archiva-modules/metadata/metadata-model/pom.xml b/archiva-modules/metadata/metadata-model/pom.xml index 4d81ad961..b4894b34e 100644 --- a/archiva-modules/metadata/metadata-model/pom.xml +++ b/archiva-modules/metadata/metadata-model/pom.xml @@ -40,6 +40,10 @@ <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-jpa_2.0_spec</artifactId> </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + </dependency> </dependencies> diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java index fd44febfd..d8e92903f 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java @@ -20,6 +20,7 @@ package org.apache.archiva.metadata.model; */ import org.apache.archiva.checksum.ChecksumAlgorithm; +import org.apache.commons.collections4.bidimap.DualHashBidiMap; import sun.reflect.generics.repository.MethodRepository; import javax.xml.bind.annotation.XmlRootElement; @@ -99,7 +100,7 @@ public class ArtifactMetadata /** * The list of checksums. */ - private Map<ChecksumAlgorithm, String> checksums = new HashMap<>(); + private Map<ChecksumAlgorithm, String> checksums = new DualHashBidiMap<>( ); private String toStringValue = ""; private int lastHash = 0; @@ -177,6 +178,10 @@ public class ArtifactMetadata return this.checksums; } + public boolean hasChecksum(String checksum) { + return this.checksums.containsValue( checksum ); + } + public void setChecksums(Map<ChecksumAlgorithm,String> checksums) { this.checksums = checksums; } |