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 nullversion - the version of the resource, which may be nullpublic String getPath()
getPath in interface ResourceEntrypublic long getSize()
getSize in interface ResourceEntrypublic String getVersion()
getVersion in interface ResourceEntrypublic List<Byte> getDigestValue(HashAlgorithm key)
getDigestValue in interface ResourceEntrypublic Map<HashAlgorithm,List<Byte>> getDigestValues()
getDigestValues in interface ResourceEntrypublic SimpleResourceEntry path(String path)
path - the path to setNullPointerException - if the provided argument was nullIllegalArgumentException - 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 nullIllegalArgumentException - 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 nullIllegalArgumentException - if the provided argument is emptyCopyright © 2020 National Institute of Standards and Technology. All rights reserved.