Class SimpleLicense

java.lang.Object
org.apache.rat.license.SimpleLicense
All Implemented Interfaces:
Comparable<ILicense>, IHeaderMatcher, ILicense

public class SimpleLicense extends Object implements ILicense
A simple implementation of ILicense.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFamily

      public String getFamily()
    • getMatcher

      public IHeaderMatcher getMatcher()
      Description copied from interface: ILicense
      Get the header matcher for this license.
      Specified by:
      getMatcher in interface ILicense
      Returns:
      the header matcher for this license.
    • getId

      public String getId()
      Description copied from interface: IHeaderMatcher
      Get the identifier for this matcher.

      All matchers must have unique identifiers

      Specified by:
      getId in interface IHeaderMatcher
      Returns:
      the identifier for this matcher.
    • reset

      public void reset()
      Description copied from interface: IHeaderMatcher
      Resets this state of this matcher to its initial state in preparation for use with another document scan. In most cases this method does not need to do anything.
      Specified by:
      reset in interface IHeaderMatcher
    • matches

      public boolean matches(IHeaders line)
      Description copied from interface: IHeaderMatcher
      Attempts to match text in the IHeaders instance.
      Specified by:
      matches in interface IHeaderMatcher
      Parameters:
      line - the representations of the headers to check
      Returns:
      true if the matcher matches the text, false otherwise.
    • getLicenseFamily

      public ILicenseFamily getLicenseFamily()
      Description copied from interface: ILicense
      Gets the license family.
      Specified by:
      getLicenseFamily in interface ILicense
      Returns:
      the ILicenseFamily implementation for this license.
    • equals

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

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

      public String getNote()
      Description copied from interface: ILicense
      Gets the note associated with the license.
      Specified by:
      getNote in interface ILicense
      Returns:
      the note associated with this license. May be null or empty.
    • getName

      public String getName()
      Description copied from interface: ILicense
      Returns the name of this license. If no name was specified then the name of the family is returned.
      Specified by:
      getName in interface ILicense
      Returns:
      the name of this license.