Package org.gbif.api.vocabulary
Enum License
- java.lang.Object
-
- java.lang.Enum<License>
-
- org.gbif.api.vocabulary.License
-
- All Implemented Interfaces:
Serializable
,Comparable<License>
public enum License extends Enum<License>
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.- See Also:
- Creative Commons recommendation, GBIF Licensing
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CC_BY_4_0
Creative Commons Attribution version 4.0.CC_BY_NC_4_0
Creative Commons Attribution-NonCommercial version 4.0.CC0_1_0
Creative Commons Zero / Public Domain version 1.0.UNSPECIFIED
No license has been specified.UNSUPPORTED
A license not supported by GBIF.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<License>
fromLicenseUrl(String licenseUrl)
Lookup a License by either its a) legal code URL or b) human readable summary URL, with HTTP or HTTPS.static Optional<License>
fromString(String license)
Get anLicense
from its name as String.String
getLicenseTitle()
String
getLicenseUrl()
static License
getMostRestrictive(License license1, License license2, License fallback)
Get the most restrictive license between the 2 provided licenses.boolean
isConcrete()
Indicates if a license is a concrete license (true) or an abstracted license (false) like UNSPECIFIED or UNSUPPORTED.static License
valueOf(String name)
Returns the enum constant of this type with the specified name.static License[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CC0_1_0
public static final License CC0_1_0
Creative Commons Zero / Public Domain version 1.0. Technically a waiver, not a license.- See Also:
- legal document
-
CC_BY_4_0
public static final License CC_BY_4_0
Creative Commons Attribution version 4.0.- See Also:
- legal document
-
CC_BY_NC_4_0
public static final License CC_BY_NC_4_0
Creative Commons Attribution-NonCommercial version 4.0.- See Also:
- legal document
-
UNSPECIFIED
public static final License UNSPECIFIED
No license has been specified.
-
UNSUPPORTED
public static final License UNSUPPORTED
A license not supported by GBIF.
-
-
Method Detail
-
values
public static License[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (License c : License.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static License valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
public static Optional<License> fromString(String license)
Get anLicense
from its name as String.- Returns:
- instance of Optional, never null
-
fromLicenseUrl
public static Optional<License> fromLicenseUrl(String licenseUrl)
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
public static License getMostRestrictive(License license1, License license2, License fallback)
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
public String getLicenseUrl()
- Returns:
- the License URL
-
getLicenseTitle
public String getLicenseTitle()
- Returns:
- the License title
-
isConcrete
public boolean 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
-
-