Package org.apache.maven.api.model
Class License
java.lang.Object
org.apache.maven.api.model.License
- All Implemented Interfaces:
Serializable,InputLocationTracker
@Experimental
@Generated
@ThreadSafe
@Immutable
public class License
extends Object
implements Serializable, InputLocationTracker
Describes the licenses for this project. This is used to generate the license
page of the project's web site, as well as being taken into consideration in other reporting
and validation. The licenses listed for the project are that of the project itself, and not
of dependencies.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create License instances. -
Method Summary
Modifier and TypeMethodDescriptionAddendum information pertaining to this license.The primary method by which this project may be distributed.getLocation(Object key) Gets the location of the specified field in the input source.getName()The full legal name of the license.getUrl()The official url for the license text.static License.BuilderCreates a newLicensebuilder instance.static License.BuildernewBuilder(boolean withDefaults) Creates a newLicensebuilder instance using default values or not.static License.BuildernewBuilder(License from) Creates a newLicensebuilder instance using the specified object as a basis.static License.BuildernewBuilder(License from, boolean forceCopy) Creates a newLicensebuilder instance using the specified object as a basis.static LicenseCreates a newLicenseinstance.static LicensenewInstance(boolean withDefaults) Creates a newLicenseinstance using default values or not.toString()with()Creates a new builder with this object as the basis.withComments(String comments) Creates a newLicenseinstance using the specified comments.withDistribution(String distribution) Creates a newLicenseinstance using the specified distribution.Creates a newLicenseinstance using the specified name.Creates a newLicenseinstance using the specified url.
-
Method Details
-
getName
The full legal name of the license.- Returns:
- a
String
-
getUrl
The official url for the license text.- Returns:
- a
String
-
getDistribution
The primary method by which this project may be distributed.- repo
- may be downloaded from the Maven repository
- manual
- user must manually download and install the dependency.
- Returns:
- a
String
-
getComments
Addendum information pertaining to this license.- Returns:
- a
String
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocationin interfaceInputLocationTracker
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withName
Creates a newLicenseinstance using the specified name.- Parameters:
name- the newStringto use- Returns:
- a
Licensewith the specified name
-
withUrl
Creates a newLicenseinstance using the specified url.- Parameters:
url- the newStringto use- Returns:
- a
Licensewith the specified url
-
withDistribution
Creates a newLicenseinstance using the specified distribution.- Parameters:
distribution- the newStringto use- Returns:
- a
Licensewith the specified distribution
-
withComments
Creates a newLicenseinstance using the specified comments.- Parameters:
comments- the newStringto use- Returns:
- a
Licensewith the specified comments
-
newInstance
Creates a newLicenseinstance. Equivalent tonewInstance(true).- Returns:
- a new
License - See Also:
-
newInstance
Creates a newLicenseinstance using default values or not. Equivalent tonewBuilder(withDefaults).build().- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
License
-
newBuilder
Creates a newLicensebuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newLicensebuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newLicensebuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theLicenseinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newLicensebuilder instance using the specified object as a basis.- Parameters:
from- theLicenseinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
toString
-