Class SimpleLicense.Builder

java.lang.Object
org.apache.rat.license.SimpleLicense.Builder
All Implemented Interfaces:
IHeaderMatcher.Builder, ILicense.Builder
Enclosing class:
SimpleLicense

public static class SimpleLicense.Builder extends Object implements ILicense.Builder
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setMatcher

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

      public SimpleLicense.Builder setMatcher(IHeaderMatcher matcher)
      Sets the matcher.
      Specified by:
      setMatcher in interface ILicense.Builder
      Parameters:
      matcher - the matcher for the license.
      Returns:
      this builder for chaining.
    • setNote

      public SimpleLicense.Builder setNote(String note)
      Sets the notes for the license. If called multiple times the notes are concatenated to create a single note.
      Specified by:
      setNote in interface ILicense.Builder
      Parameters:
      note - the note for the license.
      Returns:
      this builder.
    • setId

      public SimpleLicense.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.
      Specified by:
      setId in interface ILicense.Builder
      Parameters:
      id - the ID for the license
      Returns:
      this builder for chaining.
    • setFamily

      public SimpleLicense.Builder setFamily(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.
      Specified by:
      setFamily in interface ILicense.Builder
      Parameters:
      licenseFamilyCategory - the family category for the license.
      Returns:
      this builder for chaining.
    • setName

      public SimpleLicense.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.
      Specified by:
      setName in interface ILicense.Builder
      Parameters:
      name - the name for the license
      Returns:
      this builder for chaining.
    • setLicenseFamilies

      public SimpleLicense.Builder setLicenseFamilies(SortedSet<ILicenseFamily> licenseFamilies)
      Description copied from interface: ILicense.Builder
      Sets the set of license families to use during build.
      Specified by:
      setLicenseFamilies in interface ILicense.Builder
      Parameters:
      licenseFamilies - the license families to use
      Returns:
      this builder.
    • build

      public SimpleLicense build()
      Description copied from interface: ILicense.Builder
      Builds the license.
      Specified by:
      build in interface IHeaderMatcher.Builder
      Specified by:
      build in interface ILicense.Builder
      Returns:
      A new License implementation.