public class ClassificationUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
copyLinneanClassification(LinneanClassification source,
LinneanClassification target)
Copies all linnean classification based higher taxon names from one instance to another.
|
static void |
copyLinneanClassificationKeys(LinneanClassificationKeys source,
LinneanClassificationKeys target)
Copies all linnean classification based higher taxon keys from one instance to another.
|
static String |
getHigherClassification(LinneanClassification lc)
Concatenates all higher Linnean taxa into a single dwc:higherClassification string, skipping
null values.
|
static <T extends LinneanClassification & LinneanClassificationKeys> |
getHigherClassificationMap(T lc)
An ordered map with entries for all higher Linnean ranks down to species which are not null.
|
static <T extends LinneanClassification & LinneanClassificationKeys> |
getHigherClassificationMap(T lc,
int key,
Integer parentKey,
String parent)
An ordered map with entries for all higher Linnean ranks down to the actual direct parent of this usage.
|
static String |
getHigherRank(LinneanClassification lc,
Rank rank)
Gets a higher taxon property by passing the rank of it.
|
static Integer |
getHigherRankKey(LinneanClassificationKeys lck,
Rank rank)
Gets a higher taxon key by passing the rank of it.
|
static boolean |
hasContent(LinneanClassification lc) |
static void |
setHigherRank(LinneanClassification lc,
Rank rank,
String name)
Sets a higher taxon property by passing the rank of it.
|
static <T extends LinneanClassification & LinneanClassificationKeys> |
setHigherRank(T lc,
Rank rank,
String name,
Integer usageKey)
Sets a higher taxon property by passing the rank of it.
|
static void |
setHigherRankKey(LinneanClassificationKeys lck,
Rank rank,
Integer usageKey)
Sets a higher taxon property by passing the rank of it.
|
@Nullable public static String getHigherClassification(LinneanClassification lc)
lc
- the LinneanClassification to join into the higher classification string@Nullable public static String getHigherRank(LinneanClassification lc, Rank rank)
lc
- the LinneanClassification holding the taxon property to be retrievedrank
- the higher linnean rank to retrievepublic static void setHigherRank(LinneanClassification lc, Rank rank, String name)
lc
- the LinneanClassification on which to set the new propertyrank
- the higher linnean rank to setname
- the higher ranks name@NotNull public static <T extends LinneanClassification & LinneanClassificationKeys> @NotNull LinkedHashMap<Integer,String> getHigherClassificationMap(T lc)
lc
- the object that implements both LinneanClassification and LinneanClassificationKeys from which to build
the map@NotNull public static <T extends LinneanClassification & LinneanClassificationKeys> @NotNull LinkedHashMap<Integer,String> getHigherClassificationMap(T lc, int key, Integer parentKey, String parent)
lc
- the object that implements both LinneanClassification and LinneanClassificationKeys from which to build
the map@Nullable public static Integer getHigherRankKey(LinneanClassificationKeys lck, Rank rank)
lck
- the classification that holds the taxon keyrank
- the higher linnean rank to retrievepublic static void setHigherRankKey(LinneanClassificationKeys lck, Rank rank, Integer usageKey)
lck
- the classification on which to set the taxon propertyrank
- the higher rank to setusageKey
- key of the higher ranks usagepublic static <T extends LinneanClassification & LinneanClassificationKeys> void setHigherRank(T lc, Rank rank, String name, Integer usageKey)
lc
- the object that implements both LinneanClassification and LinneanClassificationKeys on which to set
the taxon propertyrank
- the higher linnean rank to setname
- the higher ranks nameusageKey
- key of the higher ranks usagepublic static boolean hasContent(LinneanClassification lc)
public static void copyLinneanClassificationKeys(LinneanClassificationKeys source, LinneanClassificationKeys target)
public static void copyLinneanClassification(LinneanClassification source, LinneanClassification target)
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.