Package net.bmahe.genetics4j.gpu.spec
Class ImmutableProgram.Builder
java.lang.Object
net.bmahe.genetics4j.gpu.spec.ImmutableProgram.Builder
- Enclosing class:
ImmutableProgram
Builds instances of type
ImmutableProgram
.
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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal ImmutableProgram.Builder
addAllContent
(Iterable<String> elements) Adds elements tocontent
list.final ImmutableProgram.Builder
addAllKernelNames
(Iterable<String> elements) Adds elements tokernelNames
set.final ImmutableProgram.Builder
addAllResources
(Iterable<String> elements) Adds elements toresources
set.final ImmutableProgram.Builder
addContent
(String element) Adds one element tocontent
list.final ImmutableProgram.Builder
addContent
(String... elements) Adds elements tocontent
list.final ImmutableProgram.Builder
addKernelNames
(String element) Adds one element tokernelNames
set.final ImmutableProgram.Builder
addKernelNames
(String... elements) Adds elements tokernelNames
set.final ImmutableProgram.Builder
addResources
(String element) Adds one element toresources
set.final ImmutableProgram.Builder
addResources
(String... elements) Adds elements toresources
set.build()
Builds a newImmutableProgram
.final ImmutableProgram.Builder
buildOptions
(String buildOptions) Initializes the optional valuebuildOptions
to buildOptions.final ImmutableProgram.Builder
buildOptions
(Optional<String> buildOptions) Initializes the optional valuebuildOptions
to buildOptions.final ImmutableProgram.Builder
Sets or replaces all elements forcontent
list.final ImmutableProgram.Builder
Fill a builder with attribute values from the providedProgram
instance.final ImmutableProgram.Builder
kernelNames
(Iterable<String> elements) Sets or replaces all elements forkernelNames
set.final ImmutableProgram.Builder
Sets or replaces all elements forresources
set.
-
Field Details
-
-
resources
-
kernelNames
-
buildOptions
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
Fill a builder with attribute values from the providedProgram
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
-
addContent
Adds one element tocontent
list.- Parameters:
element
- A content element- Returns:
this
builder for use in a chained invocation
-
addContent
Adds elements tocontent
list.- Parameters:
elements
- An array of content elements- Returns:
this
builder for use in a chained invocation
-
content
Sets or replaces all elements forcontent
list.- Parameters:
elements
- An iterable of content elements- Returns:
this
builder for use in a chained invocation
-
addAllContent
Adds elements tocontent
list.- Parameters:
elements
- An iterable of content elements- Returns:
this
builder for use in a chained invocation
-
addResources
Adds one element toresources
set.- Parameters:
element
- A resources element- Returns:
this
builder for use in a chained invocation
-
addResources
Adds elements toresources
set.- Parameters:
elements
- An array of resources elements- Returns:
this
builder for use in a chained invocation
-
resources
Sets or replaces all elements forresources
set.- Parameters:
elements
- An iterable of resources elements- Returns:
this
builder for use in a chained invocation
-
addAllResources
Adds elements toresources
set.- Parameters:
elements
- An iterable of resources elements- Returns:
this
builder for use in a chained invocation
-
addKernelNames
Adds one element tokernelNames
set.- Parameters:
element
- A kernelNames element- Returns:
this
builder for use in a chained invocation
-
addKernelNames
Adds elements tokernelNames
set.- Parameters:
elements
- An array of kernelNames elements- Returns:
this
builder for use in a chained invocation
-
kernelNames
Sets or replaces all elements forkernelNames
set.- Parameters:
elements
- An iterable of kernelNames elements- Returns:
this
builder for use in a chained invocation
-
addAllKernelNames
Adds elements tokernelNames
set.- Parameters:
elements
- An iterable of kernelNames elements- Returns:
this
builder for use in a chained invocation
-
buildOptions
Initializes the optional valuebuildOptions
to buildOptions.- Parameters:
buildOptions
- The value for buildOptions- Returns:
this
builder for chained invocation
-
buildOptions
Initializes the optional valuebuildOptions
to buildOptions.- Parameters:
buildOptions
- The value for buildOptions- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableProgram
.- Returns:
- An immutable instance of Program
- Throws:
IllegalStateException
- if any required attributes are missing
-