# Class JCSwapchainConfiguration.Builder

java.lang.Object
com.io7m.jcoronado.utility.swapchain.JCSwapchainConfiguration.Builder

Enclosing class:
  `JCSwapchainConfiguration`

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final JCSwapchainConfiguration.Builder`
  `addAllImageUsageFlags(Iterable<VulkanImageUsageFlag> elements)`
  Adds elements to `imageUsageFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `addAllPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements)`
  Adds elements to `preferredFormats` list.
  `final JCSwapchainConfiguration.Builder`
  `addAllPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements)`
  Adds elements to `preferredModes` list.
  `final JCSwapchainConfiguration.Builder`
  `addAllSurfaceAlphaFlags(Iterable<VulkanCompositeAlphaFlagKHR> elements)`
  Adds elements to `surfaceAlphaFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `addImageUsageFlags(VulkanImageUsageFlag element)`
  Adds one element to `imageUsageFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `addImageUsageFlags(VulkanImageUsageFlag... elements)`
  Adds elements to `imageUsageFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `addPreferredFormats(VulkanSurfaceFormatKHR element)`
  Adds one element to `preferredFormats` list.
  `final JCSwapchainConfiguration.Builder`
  `addPreferredFormats(VulkanSurfaceFormatKHR... elements)`
  Adds elements to `preferredFormats` list.
  `final JCSwapchainConfiguration.Builder`
  `addPreferredModes(VulkanPresentModeKHR element)`
  Adds one element to `preferredModes` list.
  `final JCSwapchainConfiguration.Builder`
  `addPreferredModes(VulkanPresentModeKHR... elements)`
  Adds elements to `preferredModes` list.
  `final JCSwapchainConfiguration.Builder`
  `addSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR element)`
  Adds one element to `surfaceAlphaFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `addSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR... elements)`
  Adds elements to `surfaceAlphaFlags` set.
  `JCSwapchainConfiguration`
  `build()`
  Builds a new `JCSwapchainConfiguration`.
  `final JCSwapchainConfiguration.Builder`
  `from(JCSwapchainConfigurationType instance)`
  Fill a builder with attribute values from the provided `JCSwapchainConfigurationType` instance.
  `final JCSwapchainConfiguration.Builder`
  `setDevice(VulkanLogicalDeviceType device)`
  Initializes the value for the `device` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setGraphicsQueue(VulkanQueueType graphicsQueue)`
  Initializes the value for the `graphicsQueue` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setImageUsageFlags(Iterable<VulkanImageUsageFlag> elements)`
  Sets or replaces all elements for `imageUsageFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `setPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements)`
  Sets or replaces all elements for `preferredFormats` list.
  `final JCSwapchainConfiguration.Builder`
  `setPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements)`
  Sets or replaces all elements for `preferredModes` list.
  `final JCSwapchainConfiguration.Builder`
  `setPresentationQueue(VulkanQueueType presentationQueue)`
  Initializes the value for the `presentationQueue` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setRequestedMinimumImages(int requestedMinimumImages)`
  Initializes the value for the `requestedMinimumImages` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setSurface(VulkanExtKHRSurfaceType.VulkanKHRSurfaceType surface)`
  Initializes the value for the `surface` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setSurfaceAlphaFlags(Iterable<VulkanCompositeAlphaFlagKHR> elements)`
  Sets or replaces all elements for `surfaceAlphaFlags` set.
  `final JCSwapchainConfiguration.Builder`
  `setSurfaceExtension(VulkanExtKHRSurfaceType surfaceExtension)`
  Initializes the value for the `surfaceExtension` attribute.
  `final JCSwapchainConfiguration.Builder`
  `setSwapChainExtension(VulkanExtKHRSwapChainType swapChainExtension)`
  Initializes the value for the `swapChainExtension` attribute.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### from

    public final JCSwapchainConfiguration.Builder from(JCSwapchainConfigurationType instance)
    Fill a builder with attribute values from the provided `JCSwapchainConfigurationType` 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

  - ### setRequestedMinimumImages

    public final JCSwapchainConfiguration.Builder setRequestedMinimumImages(int requestedMinimumImages)
    Initializes the value for the `requestedMinimumImages` attribute.

    If not set, this attribute will have a default value as returned by the initializer of `requestedMinimumImages`.

    Parameters:
      `requestedMinimumImages` - The value for requestedMinimumImages
    Returns:
      `this` builder for use in a chained invocation

  - ### setDevice

    public final JCSwapchainConfiguration.Builder setDevice(VulkanLogicalDeviceType device)
    Initializes the value for the `device` attribute.
    Parameters:
      `device` - The value for device
    Returns:
      `this` builder for use in a chained invocation

  - ### setSurface

    public final JCSwapchainConfiguration.Builder setSurface(VulkanExtKHRSurfaceType.VulkanKHRSurfaceType surface)
    Initializes the value for the `surface` attribute.
    Parameters:
      `surface` - The value for surface
    Returns:
      `this` builder for use in a chained invocation

  - ### setSwapChainExtension

    public final JCSwapchainConfiguration.Builder setSwapChainExtension(VulkanExtKHRSwapChainType swapChainExtension)
    Initializes the value for the `swapChainExtension` attribute.
    Parameters:
      `swapChainExtension` - The value for swapChainExtension
    Returns:
      `this` builder for use in a chained invocation

  - ### setSurfaceExtension

    public final JCSwapchainConfiguration.Builder setSurfaceExtension(VulkanExtKHRSurfaceType surfaceExtension)
    Initializes the value for the `surfaceExtension` attribute.
    Parameters:
      `surfaceExtension` - The value for surfaceExtension
    Returns:
      `this` builder for use in a chained invocation

  - ### setGraphicsQueue

    public final JCSwapchainConfiguration.Builder setGraphicsQueue(VulkanQueueType graphicsQueue)
    Initializes the value for the `graphicsQueue` attribute.
    Parameters:
      `graphicsQueue` - The value for graphicsQueue
    Returns:
      `this` builder for use in a chained invocation

  - ### setPresentationQueue

    public final JCSwapchainConfiguration.Builder setPresentationQueue(VulkanQueueType presentationQueue)
    Initializes the value for the `presentationQueue` attribute.
    Parameters:
      `presentationQueue` - The value for presentationQueue
    Returns:
      `this` builder for use in a chained invocation

  - ### addPreferredModes

    public final JCSwapchainConfiguration.Builder addPreferredModes(VulkanPresentModeKHR element)
    Adds one element to `preferredModes` list.
    Parameters:
      `element` - A preferredModes element
    Returns:
      `this` builder for use in a chained invocation

  - ### addPreferredModes

    public final JCSwapchainConfiguration.Builder addPreferredModes(VulkanPresentModeKHR... elements)
    Adds elements to `preferredModes` list.
    Parameters:
      `elements` - An array of preferredModes elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setPreferredModes

    public final JCSwapchainConfiguration.Builder setPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements)
    Sets or replaces all elements for `preferredModes` list.
    Parameters:
      `elements` - An iterable of preferredModes elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllPreferredModes

    public final JCSwapchainConfiguration.Builder addAllPreferredModes(Iterable<? extends VulkanPresentModeKHR> elements)
    Adds elements to `preferredModes` list.
    Parameters:
      `elements` - An iterable of preferredModes elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addPreferredFormats

    public final JCSwapchainConfiguration.Builder addPreferredFormats(VulkanSurfaceFormatKHR element)
    Adds one element to `preferredFormats` list.
    Parameters:
      `element` - A preferredFormats element
    Returns:
      `this` builder for use in a chained invocation

  - ### addPreferredFormats

    public final JCSwapchainConfiguration.Builder addPreferredFormats(VulkanSurfaceFormatKHR... elements)
    Adds elements to `preferredFormats` list.
    Parameters:
      `elements` - An array of preferredFormats elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setPreferredFormats

    public final JCSwapchainConfiguration.Builder setPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements)
    Sets or replaces all elements for `preferredFormats` list.
    Parameters:
      `elements` - An iterable of preferredFormats elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllPreferredFormats

    public final JCSwapchainConfiguration.Builder addAllPreferredFormats(Iterable<? extends VulkanSurfaceFormatKHR> elements)
    Adds elements to `preferredFormats` list.
    Parameters:
      `elements` - An iterable of preferredFormats elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addImageUsageFlags

    public final JCSwapchainConfiguration.Builder addImageUsageFlags(VulkanImageUsageFlag element)
    Adds one element to `imageUsageFlags` set.
    Parameters:
      `element` - A imageUsageFlags element
    Returns:
      `this` builder for use in a chained invocation

  - ### addImageUsageFlags

    public final JCSwapchainConfiguration.Builder addImageUsageFlags(VulkanImageUsageFlag... elements)
    Adds elements to `imageUsageFlags` set.
    Parameters:
      `elements` - An array of imageUsageFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setImageUsageFlags

    public final JCSwapchainConfiguration.Builder setImageUsageFlags(Iterable<VulkanImageUsageFlag> elements)
    Sets or replaces all elements for `imageUsageFlags` set.
    Parameters:
      `elements` - An iterable of imageUsageFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllImageUsageFlags

    public final JCSwapchainConfiguration.Builder addAllImageUsageFlags(Iterable<VulkanImageUsageFlag> elements)
    Adds elements to `imageUsageFlags` set.
    Parameters:
      `elements` - An iterable of imageUsageFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addSurfaceAlphaFlags

    public final JCSwapchainConfiguration.Builder addSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR element)
    Adds one element to `surfaceAlphaFlags` set.
    Parameters:
      `element` - A surfaceAlphaFlags element
    Returns:
      `this` builder for use in a chained invocation

  - ### addSurfaceAlphaFlags

    public final JCSwapchainConfiguration.Builder addSurfaceAlphaFlags(VulkanCompositeAlphaFlagKHR... elements)
    Adds elements to `surfaceAlphaFlags` set.
    Parameters:
      `elements` - An array of surfaceAlphaFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### setSurfaceAlphaFlags

    public final JCSwapchainConfiguration.Builder setSurfaceAlphaFlags(Iterable<VulkanCompositeAlphaFlagKHR> elements)
    Sets or replaces all elements for `surfaceAlphaFlags` set.
    Parameters:
      `elements` - An iterable of surfaceAlphaFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### addAllSurfaceAlphaFlags

    public final JCSwapchainConfiguration.Builder addAllSurfaceAlphaFlags(Iterable<VulkanCompositeAlphaFlagKHR> elements)
    Adds elements to `surfaceAlphaFlags` set.
    Parameters:
      `elements` - An iterable of surfaceAlphaFlags elements
    Returns:
      `this` builder for use in a chained invocation

  - ### build

    public JCSwapchainConfiguration build()
    Builds a new `JCSwapchainConfiguration`.
    Returns:
      An immutable instance of JCSwapchainConfiguration
    Throws:
      `IllegalStateException` - if any required attributes are missing