- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanMemoryRequirements
-
- All Implemented Interfaces:
VulkanMemoryRequirementsType
public final class VulkanMemoryRequirements extends java.lang.Object implements VulkanMemoryRequirementsType
- See Also:
- "VkMemoryRequirements"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanMemoryRequirements.Builder
Builds instances of typeVulkanMemoryRequirements
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
alignment()
static VulkanMemoryRequirements.Builder
builder()
Creates a builder forVulkanMemoryRequirements
.static VulkanMemoryRequirements
copyOf(VulkanMemoryRequirementsType instance)
Creates an immutable copy of aVulkanMemoryRequirementsType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMemoryRequirements
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:size
,alignment
,memoryTypeBits
.int
memoryTypeBits()
static VulkanMemoryRequirements
of(long size, long alignment, int memoryTypeBits)
Construct a new immutableVulkanMemoryRequirements
instance.long
size()
java.lang.String
toString()
Prints the immutable valueVulkanMemoryRequirements
with attribute values.VulkanMemoryRequirements
withAlignment(long value)
Copy the current immutable object by setting a value for thealignment
attribute.VulkanMemoryRequirements
withMemoryTypeBits(int value)
Copy the current immutable object by setting a value for thememoryTypeBits
attribute.VulkanMemoryRequirements
withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute.
-
-
-
Method Detail
-
size
public long size()
- Specified by:
size
in interfaceVulkanMemoryRequirementsType
- Returns:
- The size, in bytes, of the memory allocation required for the resource.
-
alignment
public long alignment()
- Specified by:
alignment
in interfaceVulkanMemoryRequirementsType
- Returns:
- The alignment, in bytes, of the offset within the allocation required for the resource.
-
memoryTypeBits
public int memoryTypeBits()
- Specified by:
memoryTypeBits
in interfaceVulkanMemoryRequirementsType
- Returns:
- A bitmask that contains one bit set for every supported memory type for the resource. Bit i is set if and only if the memory type i in the VkPhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.
-
withSize
public final VulkanMemoryRequirements withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for size- Returns:
- A modified copy of the
this
object
-
withAlignment
public final VulkanMemoryRequirements withAlignment(long value)
Copy the current immutable object by setting a value for thealignment
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for alignment- Returns:
- A modified copy of the
this
object
-
withMemoryTypeBits
public final VulkanMemoryRequirements withMemoryTypeBits(int value)
Copy the current immutable object by setting a value for thememoryTypeBits
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for memoryTypeBits- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMemoryRequirements
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:size
,alignment
,memoryTypeBits
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanMemoryRequirements
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanMemoryRequirements of(long size, long alignment, int memoryTypeBits)
Construct a new immutableVulkanMemoryRequirements
instance.- Parameters:
size
- The value for thesize
attributealignment
- The value for thealignment
attributememoryTypeBits
- The value for thememoryTypeBits
attribute- Returns:
- An immutable VulkanMemoryRequirements instance
-
copyOf
public static VulkanMemoryRequirements copyOf(VulkanMemoryRequirementsType instance)
Creates an immutable copy of aVulkanMemoryRequirementsType
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 VulkanMemoryRequirements instance
-
builder
public static VulkanMemoryRequirements.Builder builder()
Creates a builder forVulkanMemoryRequirements
.- Returns:
- A new VulkanMemoryRequirements builder
-
-