Class MavenArtifactBean
java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifactBean
- All Implemented Interfaces:
MavenArtifact
@Generated({"Modifiables.generator","MavenArtifact"})
public class MavenArtifactBean
extends Object
implements MavenArtifact
A modifiable implementation of the
MavenArtifact
type.
Use the constructor to create new modifiable instances. You may even extend this class to add some convenience methods, however most of the methods in this class are final to preserve safety and predictable invariants.
MavenArtifactBean is not thread-safe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private @Nullable String
private @Nullable DependencyResolutionDepth
private Set
<MavenExclusionBean> private String
private static final long
private static final long
private long
private @Nullable String
private @Nullable String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllExclusions
(Iterable<? extends MavenExclusionBean> elements) Adds elements toexclusions
set.void
addExclusions
(MavenExclusionBean element) Adds one element toexclusions
set.final void
addExclusions
(MavenExclusionBean... elements) Adds elements toexclusions
set.final boolean
Returnstrue
if the required attributeartifactId
is set.private void
void
clear()
Clears the object by setting all attributes to their initial values.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> Set
<T> createUnmodifiableSet
(List<T> list) Unmodifiable set constructed from list to avoid rehashing.boolean
This instance is equal to all instances ofMavenArtifactBean
that have equal attribute values.private boolean
equalTo
(MavenArtifactBean another) final boolean
Returnstrue
if theexclusions
has not been initialized and will default to an empty set.private String
from
(MavenArtifact instance) Fill this modifiable instance with attribute values from the providedMavenArtifact
instance.from
(MavenArtifactBean instance) Fill this modifiable instance with attribute values from the providedMavenArtifact
instance.Get the artifact ID.@Nullable String
Get the artifact classifier.@Nullable DependencyResolutionDepth
Get the preferences for the depth of dependency resolution.Get a set of dependency exclusions to apply when resolving dependencies.Get the group ID.@Nullable String
getType()
Get the artifact type.@Nullable String
Get the artifact version.final boolean
Returnstrue
if the required attributegroupId
is set.int
hashCode()
Computes a hash code from attributes:groupId
,artifactId
,version
,type
,classifier
,dependencyResolutionDepth
,exclusions
.final boolean
Returnstrue
if all required attributes are set, indicating that the object is initialized.void
setArtifactId
(String artifactId) Assigns a value to theartifactId
attribute.void
setClassifier
(@Nullable String classifier) Assigns a value to theclassifier
attribute.void
setDependencyResolutionDepth
(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Assigns a value to thedependencyResolutionDepth
attribute.void
setExclusions
(Set<MavenExclusionBean> elements) Sets or replaces all elements forexclusions
set.void
setGroupId
(String groupId) Assigns a value to thegroupId
attribute.void
Assigns a value to thetype
attribute.void
setVersion
(@Nullable String version) Assigns a value to theversion
attribute.toString()
Generates a string representation of thisMavenArtifact
.final void
Reset an attribute to its initial value.final void
Reset an attribute to its initial value.
-
Field Details
-
INIT_BIT_GROUP_ID
private static final long INIT_BIT_GROUP_ID- See Also:
-
INIT_BIT_ARTIFACT_ID
private static final long INIT_BIT_ARTIFACT_ID- See Also:
-
initBits
private long initBits -
groupId
-
artifactId
-
version
-
type
-
classifier
-
dependencyResolutionDepth
-
exclusions
-
-
Constructor Details
-
MavenArtifactBean
public MavenArtifactBean()
-
-
Method Details
-
getGroupId
Get the group ID.- Specified by:
getGroupId
in interfaceMavenArtifact
- Returns:
- the group ID.
-
getArtifactId
Get the artifact ID.- Specified by:
getArtifactId
in interfaceMavenArtifact
- Returns:
- the artifact ID.
-
getVersion
Get the artifact version.May be
null
if we expect to discover the version from dependency management.- Specified by:
getVersion
in interfaceMavenArtifact
- Returns:
- the version.
-
getType
Get the artifact type.May be
null
if the default should be used.- Specified by:
getType
in interfaceMavenArtifact
- Returns:
- the artifact type.
-
getClassifier
Get the artifact classifier.May be
null
if no classifier is set.- Specified by:
getClassifier
in interfaceMavenArtifact
- Returns:
- the artifact classifier.
-
getDependencyResolutionDepth
Get the preferences for the depth of dependency resolution.May be
null
if the default should be used.- Specified by:
getDependencyResolutionDepth
in interfaceMavenArtifact
- Returns:
- the preference for the depth of dependency resolution.
-
getExclusions
Get a set of dependency exclusions to apply when resolving dependencies.- Specified by:
getExclusions
in interfaceMavenArtifact
- Returns:
- the exclusions, which by default is empty.
-
clear
public void clear()Clears the object by setting all attributes to their initial values. -
from
Fill this modifiable instance with attribute values from the providedMavenArtifact
instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
for use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedMavenArtifact
instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
for use in a chained invocation
-
setGroupId
Assigns a value to thegroupId
attribute.- Parameters:
groupId
- The value for groupId, can benull
-
setArtifactId
Assigns a value to theartifactId
attribute.- Parameters:
artifactId
- The value for artifactId, can benull
-
setVersion
Assigns a value to theversion
attribute.- Parameters:
version
- The value for version, can benull
-
setType
Assigns a value to thetype
attribute.- Parameters:
type
- The value for type, can benull
-
setClassifier
Assigns a value to theclassifier
attribute.- Parameters:
classifier
- The value for classifier, can benull
-
setDependencyResolutionDepth
public void setDependencyResolutionDepth(@Nullable DependencyResolutionDepth dependencyResolutionDepth) Assigns a value to thedependencyResolutionDepth
attribute.- Parameters:
dependencyResolutionDepth
- The value for dependencyResolutionDepth, can benull
-
addExclusions
Adds one element toexclusions
set.- Parameters:
element
- The exclusions element
-
addExclusions
Adds elements toexclusions
set.- Parameters:
elements
- An array of exclusions elements
-
setExclusions
Sets or replaces all elements forexclusions
set.- Parameters:
elements
- An iterable of exclusions elements
-
addAllExclusions
Adds elements toexclusions
set.- Parameters:
elements
- An iterable of exclusions elements
-
groupIdIsSet
public final boolean groupIdIsSet()Returnstrue
if the required attributegroupId
is set.- Returns:
true
if set
-
artifactIdIsSet
public final boolean artifactIdIsSet()Returnstrue
if the required attributeartifactId
is set.- Returns:
true
if set
-
exclusionsIsSet
public final boolean exclusionsIsSet()Returnstrue
if theexclusions
has not been initialized and will default to an empty set.- Returns:
true
if set
-
unsetGroupId
public final void unsetGroupId()Reset an attribute to its initial value. -
unsetArtifactId
public final void unsetArtifactId()Reset an attribute to its initial value. -
isInitialized
public final boolean isInitialized()Returnstrue
if all required attributes are set, indicating that the object is initialized.- Returns:
true
if set
-
checkRequiredAttributes
private void checkRequiredAttributes() -
formatRequiredAttributesMessage
-
equals
-
equalTo
-
hashCode
-
toString
-
createSafeList
-
createUnmodifiableSet
-