public class DatasetKey extends Object
{NETWORK_KEY}:{DATASET_ID}This class is intended as a utility class, lacks mutability and therefore is not suitable serialization via Jackson!
Constructor and Description |
---|
DatasetKey(UUID datasetKey)
Constructor for a registered dataset key.
|
DatasetKey(UUID networkKey,
String datasetId)
Constructor for an external dataset key.
|
Modifier and Type | Method and Description |
---|---|
static DatasetKey |
fromString(String key)
Parses a datasetKey which can be either a compound external key or a simple UUID for registered datasets.
|
String |
getDatasetId() |
UUID |
getRegistryKey()
A registered UUID of either a dataset or the network of origin in the case of external datasets.
|
boolean |
isExternalKey() |
String |
toDatasetKey()
Generates the serialized dataset key as used in the
Dataset class. |
public DatasetKey(UUID datasetKey)
public DatasetKey(UUID networkKey, String datasetId)
networkKey
- of the originating networkdatasetId
- the local dataset id within the networkpublic static DatasetKey fromString(String key)
key
- a simple registered dataset uuid key or an external compound dataset keyIllegalArgumentException
- for invalid external or registered dataset keyspublic UUID getRegistryKey()
public String getDatasetId()
public boolean isExternalKey()
public String toDatasetKey()
Dataset
class.Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.