- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanOffset2D
-
- All Implemented Interfaces:
VulkanOffset2DType
public final class VulkanOffset2D extends java.lang.Object implements VulkanOffset2DType
Structure specifying a two-dimensional offset.- See Also:
- "VkOffset2D"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanOffset2D.Builder
Builds instances of typeVulkanOffset2D
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanOffset2D.Builder
builder()
Creates a builder forVulkanOffset2D
.static VulkanOffset2D
copyOf(VulkanOffset2DType instance)
Creates an immutable copy of aVulkanOffset2DType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanOffset2D
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:x
,y
.static VulkanOffset2D
of(int x, int y)
Construct a new immutableVulkanOffset2D
instance.java.lang.String
toString()
Prints the immutable valueVulkanOffset2D
with attribute values.VulkanOffset2D
withX(int value)
Copy the current immutable object by setting a value for thex
attribute.VulkanOffset2D
withY(int value)
Copy the current immutable object by setting a value for they
attribute.int
x()
int
y()
-
-
-
Method Detail
-
x
public int x()
- Specified by:
x
in interfaceVulkanOffset2DType
- Returns:
- The x offset
-
y
public int y()
- Specified by:
y
in interfaceVulkanOffset2DType
- Returns:
- The y offset
-
withX
public final VulkanOffset2D withX(int value)
Copy the current immutable object by setting a value for thex
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for x- Returns:
- A modified copy of the
this
object
-
withY
public final VulkanOffset2D withY(int value)
Copy the current immutable object by setting a value for they
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for y- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanOffset2D
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:x
,y
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanOffset2D
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanOffset2D of(int x, int y)
Construct a new immutableVulkanOffset2D
instance.- Parameters:
x
- The value for thex
attributey
- The value for they
attribute- Returns:
- An immutable VulkanOffset2D instance
-
copyOf
public static VulkanOffset2D copyOf(VulkanOffset2DType instance)
Creates an immutable copy of aVulkanOffset2DType
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 VulkanOffset2D instance
-
builder
public static VulkanOffset2D.Builder builder()
Creates a builder forVulkanOffset2D
.- Returns:
- A new VulkanOffset2D builder
-
-