- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanMemoryType
-
- All Implemented Interfaces:
VulkanMemoryTypeType
public final class VulkanMemoryType extends java.lang.Object implements VulkanMemoryTypeType
The type of a heap.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanMemoryType.Builder
Builds instances of typeVulkanMemoryType
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanMemoryType.Builder
builder()
Creates a builder forVulkanMemoryType
.static VulkanMemoryType
copyOf(VulkanMemoryTypeType instance)
Creates an immutable copy of aVulkanMemoryTypeType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanMemoryType
that have equal attribute values.java.util.Set<VulkanMemoryPropertyFlag>
flags()
int
hashCode()
Computes a hash code from attributes:heapIndex
,flags
.int
heapIndex()
static VulkanMemoryType
of(int heapIndex, java.lang.Iterable<VulkanMemoryPropertyFlag> flags)
Construct a new immutableVulkanMemoryType
instance.static VulkanMemoryType
of(int heapIndex, java.util.Set<VulkanMemoryPropertyFlag> flags)
Construct a new immutableVulkanMemoryType
instance.java.lang.String
toString()
Prints the immutable valueVulkanMemoryType
with attribute values.VulkanMemoryType
withFlags(VulkanMemoryPropertyFlag... elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanMemoryType
withFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanMemoryType
withHeapIndex(int value)
Copy the current immutable object by setting a value for theheapIndex
attribute.
-
-
-
Method Detail
-
heapIndex
public int heapIndex()
- Specified by:
heapIndex
in interfaceVulkanMemoryTypeType
- Returns:
- The memory heap to which this memory type corresponds
-
flags
public java.util.Set<VulkanMemoryPropertyFlag> flags()
- Specified by:
flags
in interfaceVulkanMemoryTypeType
- Returns:
- The properties of the heap
-
withHeapIndex
public final VulkanMemoryType withHeapIndex(int value)
Copy the current immutable object by setting a value for theheapIndex
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for heapIndex- Returns:
- A modified copy of the
this
object
-
withFlags
public final VulkanMemoryType withFlags(VulkanMemoryPropertyFlag... 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 VulkanMemoryType withFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> 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 ofVulkanMemoryType
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:heapIndex
,flags
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanMemoryType
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanMemoryType of(int heapIndex, java.util.Set<VulkanMemoryPropertyFlag> flags)
Construct a new immutableVulkanMemoryType
instance.- Parameters:
heapIndex
- The value for theheapIndex
attributeflags
- The value for theflags
attribute- Returns:
- An immutable VulkanMemoryType instance
-
of
public static VulkanMemoryType of(int heapIndex, java.lang.Iterable<VulkanMemoryPropertyFlag> flags)
Construct a new immutableVulkanMemoryType
instance.- Parameters:
heapIndex
- The value for theheapIndex
attributeflags
- The value for theflags
attribute- Returns:
- An immutable VulkanMemoryType instance
-
copyOf
public static VulkanMemoryType copyOf(VulkanMemoryTypeType instance)
Creates an immutable copy of aVulkanMemoryTypeType
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 VulkanMemoryType instance
-
builder
public static VulkanMemoryType.Builder builder()
Creates a builder forVulkanMemoryType
.- Returns:
- A new VulkanMemoryType builder
-
-