Enum 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
    • 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 name
        NullPointerException - if the argument is null
      • fromLicenseUrl

        public static Optional<LicensefromLicenseUrl​(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
      • 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