Class ILicense.Builder

java.lang.Object
org.apache.rat.license.ILicense.Builder
Enclosing interface:
ILicense

public static class ILicense.Builder extends Object
A builder for ILicense instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setMatcher

      public ILicense.Builder setMatcher(IHeaderMatcher.Builder matcher)
      Sets the matcher from a builder.
      Parameters:
      matcher - the builder for the matcher for the license.
      Returns:
      this builder for chaining.
    • setMatcher

      public ILicense.Builder setMatcher(IHeaderMatcher matcher)
      Sets the matcher.
      Parameters:
      matcher - the matcher for the license.
      Returns:
      this builder for chaining.
    • setNotes

      public ILicense.Builder setNotes(String notes)
      Sets the notes for the license. If called multiple times the notes are concatenated to create a single note.
      Parameters:
      notes - the notes for the license.
      Returns:
      this builder for chaining.
    • setId

      public ILicense.Builder setId(String id)
      Sets the ID of the license. If the ID is not set then the ID of the license family is used.
      Parameters:
      id - the ID for the license
      Returns:
      this builder for chaining.
    • setDerivedFrom

      public ILicense.Builder setDerivedFrom(String derivedFrom)
      Sets the derived from fields in the license.
      Parameters:
      derivedFrom - the family category of the license this license was derived from.
      Returns:
      this builder for chaining.
    • setLicenseFamilyCategory

      public ILicense.Builder setLicenseFamilyCategory(String licenseFamilyCategory)
      Set the family category for this license. The category must be unique across all licenses and must be 5 characters. If more than 5 characters are provided then only the first 5 are taken. If fewer than 5 characters are provided the category is padded with spaces.
      Parameters:
      licenseFamilyCategory - the family category for the license.
      Returns:
      this builder for chaining.
    • setName

      public ILicense.Builder setName(String name)
      Sets the name of the license. If the name is not set then the name of the license family is used.
      Parameters:
      name - the name for the license
      Returns:
      this builder for chaining.
    • build

      public ILicense build(SortedSet<ILicenseFamily> licenseFamilies)
      Parameters:
      licenseFamilies - the set of defined license families.
      Returns:
      A new License implementation.