- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanMemoryHeap
-
- All Implemented Interfaces:
VulkanMemoryHeapType
public final class VulkanMemoryHeap extends java.lang.Object implements VulkanMemoryHeapType
Structure specifying a memory heap.- See Also:
- "VkMemoryHeap"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanMemoryHeap.Builder
Builds instances of typeVulkanMemoryHeap
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanMemoryHeap.Builder
builder()
Creates a builder forVulkanMemoryHeap
.static VulkanMemoryHeap
copyOf(VulkanMemoryHeapType instance)
Creates an immutable copy of aVulkanMemoryHeapType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMemoryHeap
that have equal attribute values.java.util.Set<VulkanMemoryHeapFlag>
flags()
int
hashCode()
Computes a hash code from attributes:size
,flags
.static VulkanMemoryHeap
of(long size, java.lang.Iterable<VulkanMemoryHeapFlag> flags)
Construct a new immutableVulkanMemoryHeap
instance.static VulkanMemoryHeap
of(long size, java.util.Set<VulkanMemoryHeapFlag> flags)
Construct a new immutableVulkanMemoryHeap
instance.long
size()
java.lang.String
toString()
Prints the immutable valueVulkanMemoryHeap
with attribute values.VulkanMemoryHeap
withFlags(VulkanMemoryHeapFlag... elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanMemoryHeap
withFlags(java.lang.Iterable<VulkanMemoryHeapFlag> elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanMemoryHeap
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 interfaceVulkanMemoryHeapType
- Returns:
- The total memory size in bytes in the heap.
-
flags
public java.util.Set<VulkanMemoryHeapFlag> flags()
- Specified by:
flags
in interfaceVulkanMemoryHeapType
- Returns:
- The flags for the heap
-
withSize
public final VulkanMemoryHeap 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
-
withFlags
public final VulkanMemoryHeap withFlags(VulkanMemoryHeapFlag... elements)
Copy the current immutable object with elements that replace the content offlags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withFlags
public final VulkanMemoryHeap withFlags(java.lang.Iterable<VulkanMemoryHeapFlag> elements)
Copy the current immutable object with elements that replace the content offlags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of flags elements to set- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMemoryHeap
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
,flags
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanMemoryHeap
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanMemoryHeap of(long size, java.util.Set<VulkanMemoryHeapFlag> flags)
Construct a new immutableVulkanMemoryHeap
instance.- Parameters:
size
- The value for thesize
attributeflags
- The value for theflags
attribute- Returns:
- An immutable VulkanMemoryHeap instance
-
of
public static VulkanMemoryHeap of(long size, java.lang.Iterable<VulkanMemoryHeapFlag> flags)
Construct a new immutableVulkanMemoryHeap
instance.- Parameters:
size
- The value for thesize
attributeflags
- The value for theflags
attribute- Returns:
- An immutable VulkanMemoryHeap instance
-
copyOf
public static VulkanMemoryHeap copyOf(VulkanMemoryHeapType instance)
Creates an immutable copy of aVulkanMemoryHeapType
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 VulkanMemoryHeap instance
-
builder
public static VulkanMemoryHeap.Builder builder()
Creates a builder forVulkanMemoryHeap
.- Returns:
- A new VulkanMemoryHeap builder
-
-