Class License

java.lang.Object
org.savantbuild.dep.domain.License

public final class License extends Object
Domain for licenses.
  • Field Details

  • Constructor Details

    • License

      public License()
      For testing and JSON handling only.
    • License

      public License(License other)
  • Method Details

    • lookupByURL

      public static License lookupByURL(String url)
      Tries to determine the license using a URL.
      Parameters:
      url - The URL of the license text.
      Returns:
      The License if it can be found or null if it doesn't exist.
    • parse

      public static License parse(String identifier, String text) throws LicenseException
      Parses a Savant SPDX identifier to determine the type of license. Savant supports additional license types and flexible license text.
      Parameters:
      identifier - The Savant SPDX id.
      text - (Optional) The license text.
      Returns:
      The license and never null
      Throws:
      LicenseException - If the identifier was invalid.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object