Package org.apache.rat.testhelpers
Class TestingLicense
java.lang.Object
org.apache.rat.testhelpers.TestingLicense
- All Implemented Interfaces:
Comparable<ILicense>,IHeaderMatcher,ILicense
A class to quickly build testing licenses.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.license.ILicense
ILicense.Builder -
Constructor Summary
ConstructorsConstructorDescriptionTestingLicense(String id) Creates a testing license with the specified id and a default TestingMatcherTestingLicense(String family, String id) Creates a testing license with the specified id and a default TestingMatcherTestingLicense(String family, String id, IHeaderMatcher matcher) Creates a testing license with the specified id and matcher.TestingLicense(String id, IHeaderMatcher matcher, ILicenseFamily family) Creates a testing license with the specified matcher and family. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the family from the license.getId()Get the identifier for this matcher.Gets the license family.Gets the matcher from the license.getName()Returns the name of this license.getNote()Gets the note associated with the license.inthashCode()booleanAttempts to match text in the IHeaders instance.voidreset()Resets this state of this matcher to its initial state in preparation for use with another document scan.voidSets the name from value for this license.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.rat.analysis.IHeaderMatcher
getDescriptionMethods inherited from interface org.apache.rat.license.ILicense
compareTo, getFamilyName
-
Constructor Details
-
TestingLicense
Creates a testing license with the specified id and a default TestingMatcher- Parameters:
id- the id to use.- See Also:
-
TestingLicense
Creates a testing license with the specified id and a default TestingMatcher- Parameters:
family- the Family id.id- the id to use.- See Also:
-
TestingLicense
Creates a testing license with the specified id and matcher.- Parameters:
id- the id to use.matcher- the matcher to execute.
-
TestingLicense
Creates a testing license with the specified matcher and family.- Parameters:
id- the license id to use.matcher- the matcher to use.family- the family for this license.
-
-
Method Details
-
getFamily
Gets the family from the license.- Returns:
- the license family.
-
getMatcher
Gets the matcher from the license.- Specified by:
getMatcherin interfaceILicense- Returns:
- the matcher.
-
setName
Sets the name from value for this license.- Parameters:
name- the name of this license.
-
getId
Description copied from interface:IHeaderMatcherGet the identifier for this matcher.All matchers must have unique identifiers
- Specified by:
getIdin interfaceIHeaderMatcher- Returns:
- the identifier for this matcher.
-
reset
public void reset()Description copied from interface:IHeaderMatcherResets 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:
resetin interfaceIHeaderMatcher
-
matches
Description copied from interface:IHeaderMatcherAttempts to match text in the IHeaders instance.- Specified by:
matchesin interfaceIHeaderMatcher- Parameters:
line- the representations of the headers to check- Returns:
trueif the matcher matches the text,falseotherwise.
-
getLicenseFamily
Description copied from interface:ILicenseGets the license family.- Specified by:
getLicenseFamilyin interfaceILicense- Returns:
- the ILicenseFamily implementation for this license.
-
getNote
Description copied from interface:ILicenseGets the note associated with the license. -
getName
Description copied from interface:ILicenseReturns the name of this license. If no name was specified then the name of the family is returned. -
equals
-
hashCode
public int hashCode() -
toString
-