public final class VocabularyUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T extends Enum<?>> |
lookup(String name,
Class<T> vocab)
Same as
lookupEnum(String, Class) } without IllegalArgumentException. |
static <T extends Enum<?>> |
lookupEnum(String name,
Class<T> vocab)
Generic method to lookup an enumeration value for a given string based on the name of the enum member.
|
static Class<? extends Enum<?>> |
lookupVocabulary(String fullyQualifiedClassName)
Looks up an enumeration by class name.
|
static ContactType |
parseContactType(String type) |
static EndpointType |
parseEndpointType(String type) |
static IdentifierType |
parseIdentifierType(String type) |
static TechnicalInstallationType |
parseTechnicalInstallationType(String type)
Deprecated.
|
public static ContactType parseContactType(String type)
public static EndpointType parseEndpointType(String type)
public static IdentifierType parseIdentifierType(String type)
@Deprecated public static TechnicalInstallationType parseTechnicalInstallationType(String type)
public static <T extends Enum<?>> T lookupEnum(String name, Class<T> vocab)
name
- the enum members name to lookupvocab
- the enumeration classname
is null or empty (see http://dev.gbif.org/issues/browse/POR-2858)IllegalArgumentException
- if the name cannot be parsed into a known namepublic static <T extends Enum<?>> Optional<T> lookup(String name, Class<T> vocab)
lookupEnum(String, Class)
} without IllegalArgumentException.
On failure, this method will return Optional.empty().public static Class<? extends Enum<?>> lookupVocabulary(String fullyQualifiedClassName)
Country.class.getName()
fullyQualifiedClassName
- Which should name the enumeration (e.g. org.gbif.api.vocabulary.Country)fullyQualifiedClassName
is null or empty (see http://dev.gbif.org/issues/browse/POR-2858)IllegalArgumentException
- if fullyQualifiedClassName
class cannot be locatedCopyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.