Class ImmutableActivityPayloadForm.Builder
java.lang.Object
io.jenkins.plugins.trunk.model.event.ImmutableActivityPayloadForm.Builder
- Enclosing class:
ImmutableActivityPayloadForm
Builds instances of type
ImmutableActivityPayloadForm
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllMetrics
(Iterable<? extends ActivityMetricForm> elements) Adds elements tometrics
list.addAllTags
(Iterable<? extends ActivityTagForm> elements) Adds elements totags
list.addAllTimestamps
(Iterable<? extends ActivityTimestampForm> elements) Adds elements totimestamps
list.addMetrics
(ActivityMetricForm element) Adds one element tometrics
list.addMetrics
(ActivityMetricForm... elements) Adds elements tometrics
list.addTags
(ActivityTagForm element) Adds one element totags
list.addTags
(ActivityTagForm... elements) Adds elements totags
list.addTimestamps
(ActivityTimestampForm element) Adds one element totimestamps
list.addTimestamps
(ActivityTimestampForm... elements) Adds elements totimestamps
list.build()
Builds a newImmutableActivityPayloadForm
.from
(ActivityPayloadForm instance) Fill a builder with attribute values from the providedActivityPayloadForm
instance.metrics
(Iterable<? extends ActivityMetricForm> elements) Sets or replaces all elements formetrics
list.tags
(Iterable<? extends ActivityTagForm> elements) Sets or replaces all elements fortags
list.timestamps
(Iterable<? extends ActivityTimestampForm> elements) Sets or replaces all elements fortimestamps
list.
-
Method Details
-
from
Fill a builder with attribute values from the providedActivityPayloadForm
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
addMetrics
Adds one element tometrics
list.- Parameters:
element
- A metrics element- Returns:
this
builder for use in a chained invocation
-
addMetrics
Adds elements tometrics
list.- Parameters:
elements
- An array of metrics elements- Returns:
this
builder for use in a chained invocation
-
metrics
public final ImmutableActivityPayloadForm.Builder metrics(@Nullable Iterable<? extends ActivityMetricForm> elements) Sets or replaces all elements formetrics
list.- Parameters:
elements
- An iterable of metrics elements- Returns:
this
builder for use in a chained invocation
-
addAllMetrics
public final ImmutableActivityPayloadForm.Builder addAllMetrics(Iterable<? extends ActivityMetricForm> elements) Adds elements tometrics
list.- Parameters:
elements
- An iterable of metrics elements- Returns:
this
builder for use in a chained invocation
-
addTags
Adds one element totags
list.- Parameters:
element
- A tags element- Returns:
this
builder for use in a chained invocation
-
addTags
Adds elements totags
list.- Parameters:
elements
- An array of tags elements- Returns:
this
builder for use in a chained invocation
-
tags
public final ImmutableActivityPayloadForm.Builder tags(@Nullable Iterable<? extends ActivityTagForm> elements) Sets or replaces all elements fortags
list.- Parameters:
elements
- An iterable of tags elements- Returns:
this
builder for use in a chained invocation
-
addAllTags
public final ImmutableActivityPayloadForm.Builder addAllTags(Iterable<? extends ActivityTagForm> elements) Adds elements totags
list.- Parameters:
elements
- An iterable of tags elements- Returns:
this
builder for use in a chained invocation
-
addTimestamps
Adds one element totimestamps
list.- Parameters:
element
- A timestamps element- Returns:
this
builder for use in a chained invocation
-
addTimestamps
Adds elements totimestamps
list.- Parameters:
elements
- An array of timestamps elements- Returns:
this
builder for use in a chained invocation
-
timestamps
public final ImmutableActivityPayloadForm.Builder timestamps(@Nullable Iterable<? extends ActivityTimestampForm> elements) Sets or replaces all elements fortimestamps
list.- Parameters:
elements
- An iterable of timestamps elements- Returns:
this
builder for use in a chained invocation
-
addAllTimestamps
public final ImmutableActivityPayloadForm.Builder addAllTimestamps(Iterable<? extends ActivityTimestampForm> elements) Adds elements totimestamps
list.- Parameters:
elements
- An iterable of timestamps elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableActivityPayloadForm
.- Returns:
- An immutable instance of ActivityPayloadForm
- Throws:
IllegalStateException
- if any required attributes are missing
-