Class VulkanAttachmentReference

java.lang.Object
com.io7m.jcoronado.api.VulkanAttachmentReference
All Implemented Interfaces:
VulkanAttachmentReferenceType

public final class VulkanAttachmentReference extends Object implements VulkanAttachmentReferenceType
Structure specifying an attachment reference.
See Also:
  • "VkAttachmentReference"
  • Method Details

    • attachment

      public int attachment()
      Specified by:
      attachment in interface VulkanAttachmentReferenceType
      Returns:
      The index of the attachment of the render pass
    • layout

      public VulkanImageLayout layout()
      Specified by:
      layout in interface VulkanAttachmentReferenceType
      Returns:
      The layout the attachment uses during the subpass.
    • withAttachment

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of VulkanAttachmentReference 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: attachment, layout.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static VulkanAttachmentReference of(int attachment, VulkanImageLayout layout)
      Construct a new immutable VulkanAttachmentReference instance.
      Parameters:
      attachment - The value for the attachment attribute
      layout - The value for the layout attribute
      Returns:
      An immutable VulkanAttachmentReference instance
    • copyOf

      Creates an immutable copy of a VulkanAttachmentReferenceType 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 VulkanAttachmentReference instance
    • builder

      public static VulkanAttachmentReference.Builder builder()
      Creates a builder for VulkanAttachmentReference.
       VulkanAttachmentReference.builder()
          .setAttachment(int) // required attachment
          .setLayout(com.io7m.jcoronado.api.VulkanImageLayout) // required layout
          .build();
       
      Returns:
      A new VulkanAttachmentReference builder