Enum Class License

java.lang.Object
java.lang.Enum<License>
org.gbif.api.vocabulary.License
All Implemented Interfaces:
Serializable, Comparable<License>, Constable

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:
  • Enum Constant Details

  • Method Details

    • values

      public static License[] 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

      public static License valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromString

      public static Optional<License> fromString(String license)
      Get an License 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

      Returns:
      the License URL
    • 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