Package net.bmahe.genetics4j.gpu.spec
Class ImmutableProgram
java.lang.Object
net.bmahe.genetics4j.gpu.spec.Program
net.bmahe.genetics4j.gpu.spec.ImmutableProgram
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableProgram
extends Program
Immutable implementation of
Program
.
Use the builder to create immutable instances:
ImmutableProgram.builder()
.
Use the static factory method to create immutable instances:
ImmutableProgram.of()
.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableProgram.Builder
builder()
Creates a builder forImmutableProgram
.content()
static ImmutableProgram
Creates an immutable copy of aProgram
value.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 ofImmutableProgram
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableProgram another) int
hashCode()
Computes a hash code from attributes:content
,resources
,kernelNames
,buildOptions
.static ImmutableProgram
Construct a new immutableProgram
instance.static ImmutableProgram
Construct a new immutableProgram
instance.toString()
Prints the immutable valueProgram
with attribute values.private static ImmutableProgram
validate
(ImmutableProgram instance) final ImmutableProgram
withBuildOptions
(String value) Copy the current immutable object by setting a present value for the optionalbuildOptions
attribute.final ImmutableProgram
withBuildOptions
(Optional<String> optional) Copy the current immutable object by setting an optional value for thebuildOptions
attribute.final ImmutableProgram
withContent
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofcontent
.final ImmutableProgram
withContent
(String... elements) Copy the current immutable object with elements that replace the content ofcontent
.final ImmutableProgram
withKernelNames
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofkernelNames
.final ImmutableProgram
withKernelNames
(String... elements) Copy the current immutable object with elements that replace the content ofkernelNames
.final ImmutableProgram
withResources
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofresources
.final ImmutableProgram
withResources
(String... elements) Copy the current immutable object with elements that replace the content ofresources
.Methods inherited from class net.bmahe.genetics4j.gpu.spec.Program
check, ofContent, ofResource, ofResource
-
Field Details
-
-
resources
-
kernelNames
-
buildOptions
-
-
Constructor Details
-
ImmutableProgram
-
ImmutableProgram
-
-
Method Details
-
content
-
resources
-
kernelNames
- Specified by:
kernelNames
in classProgram
- Returns:
- The value of the
kernelNames
attribute
-
buildOptions
- Specified by:
buildOptions
in classProgram
- Returns:
- The value of the
buildOptions
attribute
-
withContent
Copy the current immutable object with elements that replace the content ofcontent
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withContent
Copy the current immutable object with elements that replace the content ofcontent
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of content elements to set- Returns:
- A modified copy of
this
object
-
withResources
Copy the current immutable object with elements that replace the content ofresources
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withResources
Copy the current immutable object with elements that replace the content ofresources
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of resources elements to set- Returns:
- A modified copy of
this
object
-
withKernelNames
Copy the current immutable object with elements that replace the content ofkernelNames
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withKernelNames
Copy the current immutable object with elements that replace the content ofkernelNames
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of kernelNames elements to set- Returns:
- A modified copy of
this
object
-
withBuildOptions
Copy the current immutable object by setting a present value for the optionalbuildOptions
attribute.- Parameters:
value
- The value for buildOptions- Returns:
- A modified copy of
this
object
-
withBuildOptions
Copy the current immutable object by setting an optional value for thebuildOptions
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for buildOptions- Returns:
- A modified copy of
this
object
-
equals
This instance is equal to all instances ofImmutableProgram
that have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:content
,resources
,kernelNames
,buildOptions
. -
toString
Prints the immutable valueProgram
with attribute values. -
of
public static ImmutableProgram of(List<String> content, Set<String> resources, Set<String> kernelNames) Construct a new immutableProgram
instance.- Parameters:
content
- The value for thecontent
attributeresources
- The value for theresources
attributekernelNames
- The value for thekernelNames
attribute- Returns:
- An immutable Program instance
-
of
public static ImmutableProgram of(Iterable<String> content, Iterable<String> resources, Iterable<String> kernelNames) Construct a new immutableProgram
instance.- Parameters:
content
- The value for thecontent
attributeresources
- The value for theresources
attributekernelNames
- The value for thekernelNames
attribute- Returns:
- An immutable Program instance
-
validate
-
copyOf
Creates an immutable copy of aProgram
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable Program instance
-
builder
Creates a builder forImmutableProgram
.ImmutableProgram.builder() .addContent|addAllContent(String) //
content
elements .addResources|addAllResources(String) //resources
elements .addKernelNames|addAllKernelNames(String) //kernelNames
elements .buildOptions(String) // optionalbuildOptions
.build();- Returns:
- A new ImmutableProgram builder
-
createSafeList
-
createUnmodifiableList
-
createUnmodifiableSet
Unmodifiable set constructed from list to avoid rehashing.
-