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 website, 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
Modifier and TypeClassDescriptionstatic class
Builder class used to create License instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
License
(License.Builder builder) Constructor for this class, to be called from its subclasses andLicense.Builder
. -
Method Summary
Modifier and TypeMethodDescriptionAddendum information pertaining to this license.The primary method by which this project may be distributed.Gets the input location that caused this model to be read.getLocation
(Object key) Gets the location of the specified field in the input source.Gets the keys of the locations of the input source.getName()
The full legal name of the license.getUrl()
The official url for the license text.static License.Builder
Creates a newLicense
builder instance.static License.Builder
newBuilder
(boolean withDefaults) Creates a newLicense
builder instance using default values or not.static License.Builder
newBuilder
(License from) Creates a newLicense
builder instance using the specified object as a basis.static License.Builder
newBuilder
(License from, boolean forceCopy) Creates a newLicense
builder instance using the specified object as a basis.static License
Creates a newLicense
instance.static License
newInstance
(boolean withDefaults) Creates a newLicense
instance using default values or not.toString()
with()
Creates a new builder with this object as the basis.withComments
(String comments) Creates a newLicense
instance using the specified comments.withDistribution
(String distribution) Creates a newLicense
instance using the specified distribution.Creates a newLicense
instance using the specified name.Creates a newLicense
instance using the specified url.
-
Constructor Details
-
License
Constructor for this class, to be called from its subclasses andLicense.Builder
.- See Also:
-
-
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:
getLocation
in interfaceInputLocationTracker
-
getLocationKeys
Gets the keys of the locations of the input source. -
getImportedFrom
Gets the input location that caused this model to be read.- Specified by:
getImportedFrom
in interfaceInputLocationTracker
- Returns:
- InputLocation
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withName
Creates a newLicense
instance using the specified name.- Parameters:
name
- the newString
to use- Returns:
- a
License
with the specified name
-
withUrl
Creates a newLicense
instance using the specified url.- Parameters:
url
- the newString
to use- Returns:
- a
License
with the specified url
-
withDistribution
Creates a newLicense
instance using the specified distribution.- Parameters:
distribution
- the newString
to use- Returns:
- a
License
with the specified distribution
-
withComments
Creates a newLicense
instance using the specified comments.- Parameters:
comments
- the newString
to use- Returns:
- a
License
with the specified comments
-
newInstance
Creates a newLicense
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
License
- See Also:
-
newInstance
Creates a newLicense
instance 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 newLicense
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newLicense
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newLicense
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theLicense
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newLicense
builder instance using the specified object as a basis.- Parameters:
from
- theLicense
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-
toString
-