# Class VulkanSurfaceFormatKHR

java.lang.Object
com.io7m.jcoronado.extensions.khr_surface.api.VulkanSurfaceFormatKHR

All Implemented Interfaces:
  `VulkanSurfaceFormatKHRType`

public final class VulkanSurfaceFormatKHR extends Object implements VulkanSurfaceFormatKHRType

See Also:
  - "VkSurfaceFormatKHR"

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `VulkanSurfaceFormatKHR.Builder`
  Builds instances of type `VulkanSurfaceFormatKHR`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static VulkanSurfaceFormatKHR.Builder`
  `builder()`
  Creates a builder for `VulkanSurfaceFormatKHR`.
  `VulkanColorSpaceKHR`
  `colorSpace()`
  `static VulkanSurfaceFormatKHR`
  `copyOf(VulkanSurfaceFormatKHRType instance)`
  Creates an immutable copy of a `VulkanSurfaceFormatKHRType` value.
  `boolean`
  `equals(Object another)`
  This instance is equal to all instances of `VulkanSurfaceFormatKHR` that have equal attribute values.
  `VulkanFormat`
  `format()`
  `int`
  `hashCode()`
  Computes a hash code from attributes: `format`, `colorSpace`.
  `static VulkanSurfaceFormatKHR`
  `of(VulkanFormat format, VulkanColorSpaceKHR colorSpace)`
  Construct a new immutable `VulkanSurfaceFormatKHR` instance.
  `String`
  `toString()`
  Prints the immutable value `VulkanSurfaceFormatKHR` with attribute values.
  `final VulkanSurfaceFormatKHR`
  `withColorSpace(VulkanColorSpaceKHR value)`
  Copy the current immutable object by setting a value for the `colorSpace` attribute.
  `final VulkanSurfaceFormatKHR`
  `withFormat(VulkanFormat value)`
  Copy the current immutable object by setting a value for the `format` attribute.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### format

    public VulkanFormat format()
    Specified by:
      `format` in interface `VulkanSurfaceFormatKHRType`
    Returns:
      A format that is compatible with the specified surface.

  - ### colorSpace

    public VulkanColorSpaceKHR colorSpace()
    Specified by:
      `colorSpace` in interface `VulkanSurfaceFormatKHRType`
    Returns:
      A presentation color space that is compatible with the surface.

  - ### withFormat

    public final VulkanSurfaceFormatKHR withFormat(VulkanFormat value)
    Copy the current immutable object by setting a value for the `format` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for format
    Returns:
      A modified copy or the `this` object

  - ### withColorSpace

    public final VulkanSurfaceFormatKHR withColorSpace(VulkanColorSpaceKHR value)
    Copy the current immutable object by setting a value for the `colorSpace` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
    Parameters:
      `value` - A new value for colorSpace
    Returns:
      A modified copy or the `this` object

  - ### equals

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

  - ### hashCode

    public int hashCode()
    Computes a hash code from attributes: `format`, `colorSpace`.
    Overrides:
      `hashCode` in class `Object`
    Returns:
      hashCode value

  - ### toString

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

  - ### of

    public static VulkanSurfaceFormatKHR of(VulkanFormat format, VulkanColorSpaceKHR colorSpace)
    Construct a new immutable `VulkanSurfaceFormatKHR` instance.
    Parameters:
      `format` - The value for the `format` attribute
      `colorSpace` - The value for the `colorSpace` attribute
    Returns:
      An immutable VulkanSurfaceFormatKHR instance

  - ### copyOf

    public static VulkanSurfaceFormatKHR copyOf(VulkanSurfaceFormatKHRType instance)
    Creates an immutable copy of a `VulkanSurfaceFormatKHRType` 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 VulkanSurfaceFormatKHR instance

  - ### builder

    public static VulkanSurfaceFormatKHR.Builder builder()
    Creates a builder for `VulkanSurfaceFormatKHR`.

        VulkanSurfaceFormatKHR.builder()
           .setFormat(com.io7m.jcoronado.api.VulkanFormat) // required format
           .setColorSpace(com.io7m.jcoronado.extensions.khr_swapchain.api.VulkanColorSpaceKHR) // required colorSpace
           .build();

    Returns:
      A new VulkanSurfaceFormatKHR builder