Class ImmutablePlatform.Builder

java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutablePlatform.Builder
Enclosing class:
ImmutablePlatform

public static final class ImmutablePlatform.Builder extends Object
Builds instances of type ImmutablePlatform. 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 Details

    • INIT_BIT_PLATFORM_ID

      private static final long INIT_BIT_PLATFORM_ID
      See Also:
    • INIT_BIT_PROFILE

      private static final long INIT_BIT_PROFILE
      See Also:
    • INIT_BIT_VERSION

      private static final long INIT_BIT_VERSION
      See Also:
    • INIT_BIT_NAME

      private static final long INIT_BIT_NAME
      See Also:
    • INIT_BIT_VENDOR

      private static final long INIT_BIT_VENDOR
      See Also:
    • INIT_BIT_NUM_DEVICES

      private static final long INIT_BIT_NUM_DEVICES
      See Also:
    • initBits

      private long initBits
    • platformId

      private org.jocl.cl_platform_id platformId
    • profile

      private PlatformProfile profile
    • version

      private String version
    • name

      private String name
    • vendor

      private String vendor
    • extensions

      private List<String> extensions
    • numDevices

      private int numDevices
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      public final ImmutablePlatform.Builder from(Platform instance)
      Fill a builder with attribute values from the provided Platform 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
    • platformId

      public final ImmutablePlatform.Builder platformId(org.jocl.cl_platform_id platformId)
      Initializes the value for the platformId attribute.
      Parameters:
      platformId - The value for platformId
      Returns:
      this builder for use in a chained invocation
    • profile

      public final ImmutablePlatform.Builder profile(PlatformProfile profile)
      Initializes the value for the profile attribute.
      Parameters:
      profile - The value for profile
      Returns:
      this builder for use in a chained invocation
    • version

      public final ImmutablePlatform.Builder version(String version)
      Initializes the value for the version attribute.
      Parameters:
      version - The value for version
      Returns:
      this builder for use in a chained invocation
    • name

      public final ImmutablePlatform.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • vendor

      public final ImmutablePlatform.Builder vendor(String vendor)
      Initializes the value for the vendor attribute.
      Parameters:
      vendor - The value for vendor
      Returns:
      this builder for use in a chained invocation
    • addExtensions

      public final ImmutablePlatform.Builder addExtensions(String element)
      Adds one element to extensions set.
      Parameters:
      element - A extensions element
      Returns:
      this builder for use in a chained invocation
    • addExtensions

      public final ImmutablePlatform.Builder addExtensions(String... elements)
      Adds elements to extensions set.
      Parameters:
      elements - An array of extensions elements
      Returns:
      this builder for use in a chained invocation
    • extensions

      public final ImmutablePlatform.Builder extensions(Iterable<String> elements)
      Sets or replaces all elements for extensions set.
      Parameters:
      elements - An iterable of extensions elements
      Returns:
      this builder for use in a chained invocation
    • addAllExtensions

      public final ImmutablePlatform.Builder addAllExtensions(Iterable<String> elements)
      Adds elements to extensions set.
      Parameters:
      elements - An iterable of extensions elements
      Returns:
      this builder for use in a chained invocation
    • numDevices

      public final ImmutablePlatform.Builder numDevices(int numDevices)
      Initializes the value for the numDevices attribute.
      Parameters:
      numDevices - The value for numDevices
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePlatform build()
      Builds a new ImmutablePlatform.
      Returns:
      An immutable instance of Platform
      Throws:
      IllegalStateException - if any required attributes are missing
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()