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
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder class used to create License instances. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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
-
getUrl
-
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
-
getLocation
Gets the location of the specified field in the input source.- Specified by:
getLocation
in interfaceInputLocationTracker
-
getLocationKeys
-
getLocationKeyStream
-
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
-
withUrl
-
withDistribution
-
withComments
-
newInstance
-
newInstance
-
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
-