public class SimpleResourceEntry extends Object implements ResourceEntry
Constructor and Description |
---|
SimpleResourceEntry(String path,
Map<HashAlgorithm,List<Byte>> digestValues,
Long size,
String version)
Construct a new
ResourceEntry using simple provided values. |
Modifier and Type | Method and Description |
---|---|
SimpleResourceEntry |
digestValue(HashAlgorithm algorithm,
List<Byte> bytes)
Associate a list of bytes representing a digest with the hash function used to generate the
digest for this entry.
|
List<Byte> |
getDigestValue(HashAlgorithm key) |
Map<HashAlgorithm,List<Byte>> |
getDigestValues() |
String |
getPath() |
long |
getSize() |
String |
getVersion() |
SimpleResourceEntry |
path(String path)
Set the path for this entry.
|
SimpleResourceEntry |
size(long size)
Set the size in bytes for this entry.
|
SimpleResourceEntry |
version(String version)
Set the version for this entry.
|
public SimpleResourceEntry(String path, Map<HashAlgorithm,List<Byte>> digestValues, Long size, String version)
ResourceEntry
using simple provided values.path
- a path with '/' separatorsdigestValues
- a mapping of digest algorithms to bytes based on the resources contents, which may be
null
or emptysize
- the size in bytes of the resource contents, which may be null
version
- the version of the resource, which may be null
public String getPath()
getPath
in interface ResourceEntry
public long getSize()
getSize
in interface ResourceEntry
public String getVersion()
getVersion
in interface ResourceEntry
public List<Byte> getDigestValue(HashAlgorithm key)
getDigestValue
in interface ResourceEntry
public Map<HashAlgorithm,List<Byte>> getDigestValues()
getDigestValues
in interface ResourceEntry
public SimpleResourceEntry path(String path)
path
- the path to setNullPointerException
- if the provided argument was null
IllegalArgumentException
- if the provided argument is emptypublic SimpleResourceEntry size(long size)
size
- the size to setpublic SimpleResourceEntry version(String version)
version
- the version to setNullPointerException
- if the provided argument was null
IllegalArgumentException
- if the provided argument is emptypublic SimpleResourceEntry digestValue(HashAlgorithm algorithm, List<Byte> bytes)
algorithm
- the hash function to setbytes
- the list of bytes representing the digest valueNullPointerException
- if the provided argument was null
IllegalArgumentException
- if the provided argument is emptyCopyright © 2020 National Institute of Standards and Technology. All rights reserved.