Class MavenProtocPluginBean
java.lang.Object
io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPluginBean
- All Implemented Interfaces:
MavenArtifact
,MavenProtocPlugin
,ProtocPlugin
@Generated({"Modifiables.generator","MavenProtocPlugin"})
public class MavenProtocPluginBean
extends Object
implements MavenProtocPlugin
A modifiable implementation of the
MavenProtocPlugin
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.
MavenProtocPluginBean is not thread-safe
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private @Nullable String
private Set
<MavenExclusionBean> private String
private static final long
private static final long
private static final long
private long
private boolean
private @Nullable String
private static final long
private static final long
private long
private @Nullable String
private int
private @Nullable String
private @NonNull String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllExclusions
(Iterable<? extends MavenExclusionBean> elements) Adds elements toexclusions
set.void
addAllJvmArgs
(Iterable<String> elements) Adds elements tojvmArgs
list.void
addAllJvmConfigArgs
(Iterable<String> elements) Adds elements tojvmConfigArgs
list.void
addExclusions
(MavenExclusionBean element) Adds one element toexclusions
set.final void
addExclusions
(MavenExclusionBean... elements) Adds elements toexclusions
set.void
addJvmArgs
(String element) Adds one element tojvmArgs
list.final void
addJvmArgs
(String... elements) Adds elements tojvmArgs
list.void
addJvmConfigArgs
(String element) Adds one element tojvmConfigArgs
list.final void
addJvmConfigArgs
(String... elements) Adds elements tojvmConfigArgs
list.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> List
<T> createUnmodifiableList
(boolean clone, List<T> list) 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 ofMavenProtocPluginBean
that have equal attribute values.private boolean
equalTo
(MavenProtocPluginBean 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
(MavenProtocPlugin instance) Fill this modifiable instance with attribute values from the providedMavenProtocPlugin
instance.from
(MavenProtocPluginBean instance) Fill this modifiable instance with attribute values from the providedMavenProtocPlugin
instance.from
(ProtocPlugin instance) Fill this modifiable instance with attribute values from the providedProtocPlugin
instance.private void
Get the artifact ID.@Nullable String
Get the artifact classifier.@Nullable DependencyResolutionDepth
The dependency resolution depth.Get a set of dependency exclusions to apply when resolving dependencies.Get the group ID.Get the command line arguments to pass to the JVM.Get the arguments to pass to the JVM to configure it.@Nullable String
The main class entrypoint to use if the plugin is not an assembled JAR.@Nullable String
int
getOrder()
@Nullable String
getType()
Get the artifact type.@NonNull String
Get the version of theprotoc
plugin.final boolean
Returnstrue
if the required attributegroupId
is set.int
hashCode()
Computes a hash code from attributes:groupId
,artifactId
,type
,classifier
,exclusions
,options
,order
,isSkip
,version
,jvmArgs
,dependencyResolutionDepth
,jvmConfigArgs
,mainClass
.final boolean
Returnstrue
if all required attributes are set, indicating that the object is initialized.boolean
isSkip()
final boolean
Returnstrue
if the default attributeisSkip
is set.final boolean
Returnstrue
if thejvmArgs
has not been initialized and will default to an empty list.final boolean
Returnstrue
if thejvmConfigArgs
has not been initialized and will default to an empty list.final boolean
Returnstrue
if the default attributeorder
is set.void
setArtifactId
(String artifactId) Assigns a value to theartifactId
attribute.void
setClassifier
(@Nullable String classifier) Assigns a value to theclassifier
attribute.void
setExclusions
(Set<MavenExclusionBean> elements) Sets or replaces all elements forexclusions
set.void
setGroupId
(String groupId) Assigns a value to thegroupId
attribute.void
setIsSkip
(boolean isSkip) Assigns a value to theisSkip
attribute.void
setJvmArgs
(@Nullable List<String> elements) Sets or replaces all elements forjvmArgs
list.void
setJvmConfigArgs
(@Nullable List<String> elements) Sets or replaces all elements forjvmConfigArgs
list.void
setMainClass
(@Nullable String mainClass) Assigns a value to themainClass
attribute.void
setOptions
(@Nullable String options) Assigns a value to theoptions
attribute.void
setOrder
(int order) Assigns a value to theorder
attribute.void
Assigns a value to thetype
attribute.void
setVersion
(@NonNull String version) Assigns a value to theversion
attribute.Converts toImmutableMavenProtocPlugin
.toString()
Generates a string representation of thisMavenProtocPlugin
.final void
Reset an attribute to its initial value.final void
Reset an attribute to its initial value.final void
Reset an attribute to its initial value.final void
Reset an attribute to its initial value.final void
Reset an attribute to its initial value.final boolean
Returnstrue
if the required attributeversion
is set.
-
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:
-
INIT_BIT_VERSION
private static final long INIT_BIT_VERSION- See Also:
-
OPT_BIT_ORDER
private static final long OPT_BIT_ORDER- See Also:
-
OPT_BIT_IS_SKIP
private static final long OPT_BIT_IS_SKIP- See Also:
-
initBits
private long initBits -
optBits
private long optBits -
groupId
-
artifactId
-
type
-
classifier
-
exclusions
-
options
-
order
private int order -
isSkip
private boolean isSkip -
version
-
jvmArgs
-
jvmConfigArgs
-
mainClass
-
-
Constructor Details
-
MavenProtocPluginBean
public MavenProtocPluginBean()
-
-
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.
-
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.
-
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.
-
getOptions
- Specified by:
getOptions
in interfaceProtocPlugin
- Returns:
- value of
options
attribute, may benull
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceProtocPlugin
- Returns:
- assigned or, otherwise, newly computed, not cached value of
order
attribute
-
isSkip
public boolean isSkip()- Specified by:
isSkip
in interfaceProtocPlugin
- Returns:
- assigned or, otherwise, newly computed, not cached value of
isSkip
attribute
-
getVersion
Get the version of theprotoc
plugin.This must be specified for plugins.
- Specified by:
getVersion
in interfaceMavenArtifact
- Specified by:
getVersion
in interfaceMavenProtocPlugin
- Returns:
- the protoc plugin version to use.
-
getJvmArgs
Get the command line arguments to pass to the JVM.This defaults to an empty list.
- Specified by:
getJvmArgs
in interfaceMavenProtocPlugin
- Returns:
- the list of command line arguments to pass to the JVM.
- Since:
- 2.6.0
-
getDependencyResolutionDepth
The dependency resolution depth.This cannot be changed for this type of plugin.
- Specified by:
getDependencyResolutionDepth
in interfaceMavenArtifact
- Specified by:
getDependencyResolutionDepth
in interfaceMavenProtocPlugin
- Returns:
null
, always.
-
getJvmConfigArgs
Get the arguments to pass to the JVM to configure it.Users can use this to control concerns such as heap memory controls, GC and JIT settings, and specifying additional JVM options.
- Specified by:
getJvmConfigArgs
in interfaceMavenProtocPlugin
- Returns:
- the list of command line arguments to pass to the JVM.
- Since:
- 2.6.0
-
getMainClass
The main class entrypoint to use if the plugin is not an assembled JAR.Ignored in all other cases.
- Specified by:
getMainClass
in interfaceMavenProtocPlugin
- Returns:
- the main class name.
- Since:
- 2.5.0
-
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 providedMavenProtocPlugin
instance.- Parameters:
instance
- The instance from which to copy values
-
from
Fill this modifiable instance with attribute values from the providedProtocPlugin
instance.- Parameters:
instance
- The instance from which to copy values
-
from
Fill this modifiable instance with attribute values from the providedMavenArtifact
instance.- Parameters:
instance
- The instance from which to copy values
-
from
Fill this modifiable instance with attribute values from the providedMavenProtocPlugin
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
-
setGroupId
-
setArtifactId
Assigns a value to theartifactId
attribute.- Parameters:
artifactId
- The value for artifactId, can benull
-
setType
-
setClassifier
Assigns a value to theclassifier
attribute.- Parameters:
classifier
- The value for classifier, 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
-
setOptions
-
setOrder
-
setIsSkip
-
setVersion
-
addJvmArgs
-
addJvmArgs
-
setJvmArgs
-
addAllJvmArgs
-
addJvmConfigArgs
Adds one element tojvmConfigArgs
list.- Parameters:
element
- The jvmConfigArgs element
-
addJvmConfigArgs
Adds elements tojvmConfigArgs
list.- Parameters:
elements
- An array of jvmConfigArgs elements
-
setJvmConfigArgs
Sets or replaces all elements forjvmConfigArgs
list.- Parameters:
elements
- An iterable of jvmConfigArgs elements, can benull
-
addAllJvmConfigArgs
Adds elements tojvmConfigArgs
list.- Parameters:
elements
- An iterable of jvmConfigArgs elements
-
setMainClass
-
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
-
versionIsSet
public final boolean versionIsSet()Returnstrue
if the required attributeversion
is set.- Returns:
true
if set
-
orderIsSet
public final boolean orderIsSet()Returnstrue
if the default attributeorder
is set.- Returns:
true
if set
-
isSkipIsSet
public final boolean isSkipIsSet()Returnstrue
if the default attributeisSkip
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
-
jvmArgsIsSet
public final boolean jvmArgsIsSet()Returnstrue
if thejvmArgs
has not been initialized and will default to an empty list.- Returns:
true
if set
-
jvmConfigArgsIsSet
public final boolean jvmConfigArgsIsSet()Returnstrue
if thejvmConfigArgs
has not been initialized and will default to an empty list.- 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. -
unsetVersion
public final void unsetVersion()Reset an attribute to its initial value. -
unsetOrder
public final void unsetOrder()Reset an attribute to its initial value. -
unsetIsSkip
public final void unsetIsSkip()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
-
toImmutable
Converts toImmutableMavenProtocPlugin
.- Returns:
- An immutable instance of MavenProtocPlugin
-
equals
-
equalTo
-
hashCode
-
toString
-
createSafeList
-
createUnmodifiableList
-
createUnmodifiableSet
-