Package org.gbif.api.vocabulary
Enum Class License
- All Implemented Interfaces:
Serializable
,Comparable<License>
,Constable
Enumeration of the set of licenses GBIF supports for applying to a dataset. The license provides a standardised way
to define appropriate uses of a dataset.
GBIF's recommended best practice is to use the most recent license version, which for CC-BY and CC-BY-NC is 4.0.
This is in line with the recommendation from Creative Commons.
The ordinal number in the Enum implicitly defines the level of restriction, see LicenseTest.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCreative Commons Attribution version 4.0.Creative Commons Attribution-NonCommercial version 4.0.Creative Commons Zero / Public Domain version 1.0.No license has been specified.A license not supported by GBIF. -
Method Summary
Modifier and TypeMethodDescriptionfromLicenseUrl
(String licenseUrl) Lookup a License by either its a) legal code URL or b) human readable summary URL, with HTTP or HTTPS.fromString
(String license) Get anLicense
from its name as String.static License
getMostRestrictive
(License license1, License license2, License fallback) Get the most restrictive license between the 2 provided licenses.boolean
Indicates if a license is a concrete license (true) or an abstracted license (false) like UNSPECIFIED or UNSUPPORTED.static License
Returns the enum constant of this class with the specified name.static License[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
CC0_1_0
Creative Commons Zero / Public Domain version 1.0. Technically a waiver, not a license.- See Also:
-
CC_BY_4_0
Creative Commons Attribution version 4.0.- See Also:
-
CC_BY_NC_4_0
Creative Commons Attribution-NonCommercial version 4.0.- See Also:
-
UNSPECIFIED
No license has been specified. -
UNSUPPORTED
A license not supported by GBIF.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
Get anLicense
from its name as String.- Returns:
- instance of Optional, never null
-
fromLicenseUrl
Lookup a License by either its a) legal code URL or b) human readable summary URL, with HTTP or HTTPS. For any parsing see LicenseParser in GBIF parsers project.- Parameters:
licenseUrl
- the case insensitive URL for the license.- Returns:
- instance of Optional, never null
-
getMostRestrictive
Get the most restrictive license between the 2 provided licenses. If one or the two licenses are null or not concrete, this method returns the fallback License.- Parameters:
fallback
- License to return if one or the two licenses are null or not concrete- Returns:
- the most restrictive License or the fallback License
-
getLicenseUrl
- Returns:
- the License URL
-
getLicenseTitle
- Returns:
- the License title
-
isConcrete
Indicates if a license is a concrete license (true) or an abstracted license (false) like UNSPECIFIED or UNSUPPORTED.- Returns:
- the license if concrete or not
-