Class ImmutablePlatform

java.lang.Object
net.bmahe.genetics4j.gpu.opencl.model.ImmutablePlatform
All Implemented Interfaces:
Platform

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutablePlatform extends Object implements Platform
Immutable implementation of Platform.

Use the builder to create immutable instances: ImmutablePlatform.builder().

  • Field Details

    • platformId

      private final org.jocl.cl_platform_id platformId
    • profile

      private final PlatformProfile profile
    • version

      private final String version
    • name

      private final String name
    • vendor

      private final String vendor
    • extensions

      private final Set<String> extensions
    • numDevices

      private final int numDevices
  • Constructor Details

  • Method Details

    • platformId

      public org.jocl.cl_platform_id platformId()
      Specified by:
      platformId in interface Platform
      Returns:
      The value of the platformId attribute
    • profile

      public PlatformProfile profile()
      Specified by:
      profile in interface Platform
      Returns:
      The value of the profile attribute
    • version

      public String version()
      Specified by:
      version in interface Platform
      Returns:
      The value of the version attribute
    • name

      public String name()
      Specified by:
      name in interface Platform
      Returns:
      The value of the name attribute
    • vendor

      public String vendor()
      Specified by:
      vendor in interface Platform
      Returns:
      The value of the vendor attribute
    • extensions

      public Set<String> extensions()
      Specified by:
      extensions in interface Platform
      Returns:
      The value of the extensions attribute
    • numDevices

      public int numDevices()
      Specified by:
      numDevices in interface Platform
      Returns:
      The value of the numDevices attribute
    • withPlatformId

      public final ImmutablePlatform withPlatformId(org.jocl.cl_platform_id value)
      Copy the current immutable object by setting a value for the platformId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for platformId
      Returns:
      A modified copy of the this object
    • withProfile

      public final ImmutablePlatform withProfile(PlatformProfile value)
      Copy the current immutable object by setting a value for the profile attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for profile
      Returns:
      A modified copy of the this object
    • withVersion

      public final ImmutablePlatform withVersion(String value)
      Copy the current immutable object by setting a value for the version attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutablePlatform withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withVendor

      public final ImmutablePlatform withVendor(String value)
      Copy the current immutable object by setting a value for the vendor attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for vendor
      Returns:
      A modified copy of the this object
    • withExtensions

      public final ImmutablePlatform withExtensions(String... elements)
      Copy the current immutable object with elements that replace the content of extensions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtensions

      public final ImmutablePlatform withExtensions(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of extensions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of extensions elements to set
      Returns:
      A modified copy of this object
    • withNumDevices

      public final ImmutablePlatform withNumDevices(int value)
      Copy the current immutable object by setting a value for the numDevices attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for numDevices
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutablePlatform that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutablePlatform another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: platformId, profile, version, name, vendor, extensions, numDevices.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Platform with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutablePlatform copyOf(Platform instance)
      Creates an immutable copy of a Platform 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 Platform instance
    • builder

      public static ImmutablePlatform.Builder builder()
      Creates a builder for ImmutablePlatform.
       ImmutablePlatform.builder()
          .platformId(org.jocl.cl_platform_id) // required platformId
          .profile(net.bmahe.genetics4j.gpu.opencl.model.PlatformProfile) // required profile
          .version(String) // required version
          .name(String) // required name
          .vendor(String) // required vendor
          .addExtensions|addAllExtensions(String) // extensions elements
          .numDevices(int) // required numDevices
          .build();
       
      Returns:
      A new ImmutablePlatform builder
    • createSafeList

      private static <T> List<T> createSafeList(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls)
    • createUnmodifiableSet

      private static <T> Set<T> createUnmodifiableSet(List<T> list)
      Unmodifiable set constructed from list to avoid rehashing.