public static final class ImmutableComponent.Builder extends Object
ImmutableComponent.
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.
| Constructor and Description |
|---|
Builder()
Creates a builder for
ImmutableComponent instances. |
| Modifier and Type | Method and Description |
|---|---|
ImmutableComponent.Builder |
alternativeSchemes(Optional<String> alternativeSchemes)
Initializes the optional value
alternativeSchemes to alternativeSchemes. |
ImmutableComponent.Builder |
alternativeSchemes(String alternativeSchemes)
Initializes the optional value
alternativeSchemes to alternativeSchemes. |
ImmutableComponent.Builder |
alternativeSyntax(Optional<String> alternativeSyntax)
Initializes the optional value
alternativeSyntax to alternativeSyntax. |
ImmutableComponent.Builder |
alternativeSyntax(String alternativeSyntax)
Initializes the optional value
alternativeSyntax to alternativeSyntax. |
ImmutableComponent.Builder |
artifactId(String artifactId)
Initializes the value for the
artifactId attribute. |
ImmutableComponent |
build()
Builds a new
ImmutableComponent. |
ImmutableComponent.Builder |
consumerOnly(String consumerOnly)
Initializes the value for the
consumerOnly attribute. |
ImmutableComponent.Builder |
deprecated(String deprecated)
Initializes the value for the
deprecated attribute. |
ImmutableComponent.Builder |
description(String description)
Initializes the value for the
description attribute. |
ImmutableComponent.Builder |
firstVersion(Optional<String> firstVersion)
Initializes the optional value
firstVersion to firstVersion. |
ImmutableComponent.Builder |
firstVersion(String firstVersion)
Initializes the optional value
firstVersion to firstVersion. |
ImmutableComponent.Builder |
from(ComponentDefinition.Component instance)
Fill a builder with attribute values from the provided
Component instance. |
ImmutableComponent.Builder |
groupId(String groupId)
Initializes the value for the
groupId attribute. |
ImmutableComponent.Builder |
javaType(String javaType)
Initializes the value for the
javaType attribute. |
ImmutableComponent.Builder |
kind(String kind)
Initializes the value for the
kind attribute. |
ImmutableComponent.Builder |
label(String label)
Initializes the value for the
label attribute. |
ImmutableComponent.Builder |
producerOnly(String producerOnly)
Initializes the value for the
producerOnly attribute. |
ImmutableComponent.Builder |
scheme(String scheme)
Initializes the value for the
scheme attribute. |
ImmutableComponent.Builder |
syntax(String syntax)
Initializes the value for the
syntax attribute. |
ImmutableComponent.Builder |
title(String title)
Initializes the value for the
title attribute. |
ImmutableComponent.Builder |
version(String version)
Initializes the value for the
version attribute. |
public Builder()
ImmutableComponent instances.
new ImmutableComponent.Builder()
.kind(String) // required kind
.scheme(String) // required scheme
.syntax(String) // required syntax
.title(String) // required title
.description(String) // required description
.label(String) // required label
.deprecated(String) // required deprecated
.consumerOnly(String) // required consumerOnly
.producerOnly(String) // required producerOnly
.javaType(String) // required javaType
.groupId(String) // required groupId
.artifactId(String) // required artifactId
.version(String) // required version
.alternativeSyntax(String) // optional alternativeSyntax
.alternativeSchemes(String) // optional alternativeSchemes
.firstVersion(String) // optional firstVersion
.build();
public final ImmutableComponent.Builder from(ComponentDefinition.Component instance)
Component instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableComponent.Builder kind(String kind)
kind attribute.kind - The value for kindthis builder for use in a chained invocationpublic final ImmutableComponent.Builder scheme(String scheme)
scheme attribute.scheme - The value for schemethis builder for use in a chained invocationpublic final ImmutableComponent.Builder syntax(String syntax)
syntax attribute.syntax - The value for syntaxthis builder for use in a chained invocationpublic final ImmutableComponent.Builder title(String title)
title attribute.title - The value for titlethis builder for use in a chained invocationpublic final ImmutableComponent.Builder description(String description)
description attribute.description - The value for descriptionthis builder for use in a chained invocationpublic final ImmutableComponent.Builder label(String label)
label attribute.label - The value for labelthis builder for use in a chained invocationpublic final ImmutableComponent.Builder deprecated(String deprecated)
deprecated attribute.deprecated - The value for deprecatedthis builder for use in a chained invocationpublic final ImmutableComponent.Builder consumerOnly(String consumerOnly)
consumerOnly attribute.consumerOnly - The value for consumerOnlythis builder for use in a chained invocationpublic final ImmutableComponent.Builder producerOnly(String producerOnly)
producerOnly attribute.producerOnly - The value for producerOnlythis builder for use in a chained invocationpublic final ImmutableComponent.Builder javaType(String javaType)
javaType attribute.javaType - The value for javaTypethis builder for use in a chained invocationpublic final ImmutableComponent.Builder groupId(String groupId)
groupId attribute.groupId - The value for groupIdthis builder for use in a chained invocationpublic final ImmutableComponent.Builder artifactId(String artifactId)
artifactId attribute.artifactId - The value for artifactIdthis builder for use in a chained invocationpublic final ImmutableComponent.Builder version(String version)
version attribute.version - The value for versionthis builder for use in a chained invocationpublic final ImmutableComponent.Builder alternativeSyntax(String alternativeSyntax)
alternativeSyntax to alternativeSyntax.alternativeSyntax - The value for alternativeSyntaxthis builder for chained invocationpublic final ImmutableComponent.Builder alternativeSyntax(Optional<String> alternativeSyntax)
alternativeSyntax to alternativeSyntax.alternativeSyntax - The value for alternativeSyntaxthis builder for use in a chained invocationpublic final ImmutableComponent.Builder alternativeSchemes(String alternativeSchemes)
alternativeSchemes to alternativeSchemes.alternativeSchemes - The value for alternativeSchemesthis builder for chained invocationpublic final ImmutableComponent.Builder alternativeSchemes(Optional<String> alternativeSchemes)
alternativeSchemes to alternativeSchemes.alternativeSchemes - The value for alternativeSchemesthis builder for use in a chained invocationpublic final ImmutableComponent.Builder firstVersion(String firstVersion)
firstVersion to firstVersion.firstVersion - The value for firstVersionthis builder for chained invocationpublic final ImmutableComponent.Builder firstVersion(Optional<String> firstVersion)
firstVersion to firstVersion.firstVersion - The value for firstVersionthis builder for use in a chained invocationpublic ImmutableComponent build()
ImmutableComponent.IllegalStateException - if any required attributes are missingCopyright © 2016–2019 Red Hat. All rights reserved.