Class DefaultChecksumAlgorithmFactorySelector
- java.lang.Object
-
- org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector
-
- All Implemented Interfaces:
ChecksumAlgorithmFactorySelector
@Singleton @Named public class DefaultChecksumAlgorithmFactorySelector extends java.lang.Object implements ChecksumAlgorithmFactorySelector
Default implementation.- Since:
- 1.8.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,ChecksumAlgorithmFactory>
factories
-
Constructor Summary
Constructors Constructor Description DefaultChecksumAlgorithmFactorySelector()
Deprecated.DefaultChecksumAlgorithmFactorySelector(java.util.Map<java.lang.String,ChecksumAlgorithmFactory> factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ChecksumAlgorithmFactory>
getChecksumAlgorithmFactories()
Returns immutable collection of all supported algorithms.boolean
isChecksumExtension(java.lang.String extension)
Returnstrue
if passed in extension matches any known checksum extension.ChecksumAlgorithmFactory
select(java.lang.String algorithmName)
Returns factory for given algorithm name, or throws if algorithm not supported.java.util.List<ChecksumAlgorithmFactory>
selectList(java.util.Collection<java.lang.String> algorithmNames)
Returns a list of factories in same order as algorithm names are ordered, or throws if any of the algorithm name is not supported.
-
-
-
Field Detail
-
factories
private final java.util.Map<java.lang.String,ChecksumAlgorithmFactory> factories
-
-
Constructor Detail
-
DefaultChecksumAlgorithmFactorySelector
@Deprecated public DefaultChecksumAlgorithmFactorySelector()
Deprecated.Default ctor for SL.
-
DefaultChecksumAlgorithmFactorySelector
@Inject public DefaultChecksumAlgorithmFactorySelector(java.util.Map<java.lang.String,ChecksumAlgorithmFactory> factories)
-
-
Method Detail
-
select
public ChecksumAlgorithmFactory select(java.lang.String algorithmName)
Description copied from interface:ChecksumAlgorithmFactorySelector
Returns factory for given algorithm name, or throws if algorithm not supported.- Specified by:
select
in interfaceChecksumAlgorithmFactorySelector
-
selectList
public java.util.List<ChecksumAlgorithmFactory> selectList(java.util.Collection<java.lang.String> algorithmNames)
Description copied from interface:ChecksumAlgorithmFactorySelector
Returns a list of factories in same order as algorithm names are ordered, or throws if any of the algorithm name is not supported. The returned list has equal count of elements as passed in collection of names, and if names contains duplicated elements, the returned list of algorithms will have duplicates as well.- Specified by:
selectList
in interfaceChecksumAlgorithmFactorySelector
-
getChecksumAlgorithmFactories
public java.util.Collection<ChecksumAlgorithmFactory> getChecksumAlgorithmFactories()
Description copied from interface:ChecksumAlgorithmFactorySelector
Returns immutable collection of all supported algorithms. This set represents ALL the algorithms supported by Resolver, and is NOT in any relation to given repository layout used checksums, returned by methodRepositoryLayout.getChecksumAlgorithmFactories()
(in fact, is super set of it).- Specified by:
getChecksumAlgorithmFactories
in interfaceChecksumAlgorithmFactorySelector
-
isChecksumExtension
public boolean isChecksumExtension(java.lang.String extension)
Description copied from interface:ChecksumAlgorithmFactorySelector
Returnstrue
if passed in extension matches any known checksum extension. The extension string may start or contain dot ("."), but does not have to. In former case "ends with" is checked (i.e. "jar.sha1" -> true; ".sha1" -> true) while in latter equality (i.e. "sha1" -> true).- Specified by:
isChecksumExtension
in interfaceChecksumAlgorithmFactorySelector
-
-