Class VulkanRectangle2D

  • All Implemented Interfaces:
    VulkanRectangle2DType

    public final class VulkanRectangle2D
    extends java.lang.Object
    implements VulkanRectangle2DType
    Structure specifying a two-dimensional subregion.
    See Also:
    "VkRect2D"
    • Method Detail

      • withOffset

        public final VulkanRectangle2D withOffset​(VulkanOffset2D value)
        Copy the current immutable object by setting a value for the offset attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for offset
        Returns:
        A modified copy of the this object
      • withExtent

        public final VulkanRectangle2D withExtent​(VulkanExtent2D value)
        Copy the current immutable object by setting a value for the extent attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for extent
        Returns:
        A modified copy of the this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: offset, extent.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static VulkanRectangle2D of​(VulkanOffset2D offset,
                                           VulkanExtent2D extent)
        Construct a new immutable VulkanRectangle2D instance.
        Parameters:
        offset - The value for the offset attribute
        extent - The value for the extent attribute
        Returns:
        An immutable VulkanRectangle2D instance
      • copyOf

        public static VulkanRectangle2D copyOf​(VulkanRectangle2DType instance)
        Creates an immutable copy of a VulkanRectangle2DType 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 VulkanRectangle2D instance