- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanRectangle2D
-
- All Implemented Interfaces:
VulkanRectangle2DType
public final class VulkanRectangle2D extends java.lang.Object implements VulkanRectangle2DType
Structure specifying a two-dimensional subregion.- See Also:
- "VkRect2D"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanRectangle2D.Builder
Builds instances of typeVulkanRectangle2D
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanRectangle2D.Builder
builder()
Creates a builder forVulkanRectangle2D
.static VulkanRectangle2D
copyOf(VulkanRectangle2DType instance)
Creates an immutable copy of aVulkanRectangle2DType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanRectangle2D
that have equal attribute values.VulkanExtent2D
extent()
int
hashCode()
Computes a hash code from attributes:offset
,extent
.static VulkanRectangle2D
of(VulkanOffset2D offset, VulkanExtent2D extent)
Construct a new immutableVulkanRectangle2D
instance.VulkanOffset2D
offset()
java.lang.String
toString()
Prints the immutable valueVulkanRectangle2D
with attribute values.VulkanRectangle2D
withExtent(VulkanExtent2D value)
Copy the current immutable object by setting a value for theextent
attribute.VulkanRectangle2D
withOffset(VulkanOffset2D value)
Copy the current immutable object by setting a value for theoffset
attribute.
-
-
-
Method Detail
-
offset
public VulkanOffset2D offset()
- Specified by:
offset
in interfaceVulkanRectangle2DType
- Returns:
- The offset
-
extent
public VulkanExtent2D extent()
- Specified by:
extent
in interfaceVulkanRectangle2DType
- Returns:
- The extent
-
withOffset
public final VulkanRectangle2D withOffset(VulkanOffset2D value)
Copy the current immutable object by setting a value for theoffset
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 theextent
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 ofVulkanRectangle2D
that have equal attribute values.- Overrides:
equals
in classjava.lang.Object
- Returns:
true
ifthis
is equal toanother
instance
-
hashCode
public int hashCode()
Computes a hash code from attributes:offset
,extent
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanRectangle2D
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanRectangle2D of(VulkanOffset2D offset, VulkanExtent2D extent)
Construct a new immutableVulkanRectangle2D
instance.- Parameters:
offset
- The value for theoffset
attributeextent
- The value for theextent
attribute- Returns:
- An immutable VulkanRectangle2D instance
-
copyOf
public static VulkanRectangle2D copyOf(VulkanRectangle2DType instance)
Creates an immutable copy of aVulkanRectangle2DType
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
-
builder
public static VulkanRectangle2D.Builder builder()
Creates a builder forVulkanRectangle2D
.- Returns:
- A new VulkanRectangle2D builder
-
-