- java.lang.Object
-
- com.io7m.jcoronado.vma.VMAAllocationCreateInfo
-
- All Implemented Interfaces:
VMAAllocationCreateInfoType
public final class VMAAllocationCreateInfo extends java.lang.Object implements VMAAllocationCreateInfoType
Information required to create an allocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VMAAllocationCreateInfo.Builder
Builds instances of typeVMAAllocationCreateInfo
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VMAAllocationCreateInfo.Builder
builder()
Creates a builder forVMAAllocationCreateInfo
.static VMAAllocationCreateInfo
copyOf(VMAAllocationCreateInfoType instance)
Creates an immutable copy of aVMAAllocationCreateInfoType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVMAAllocationCreateInfo
that have equal attribute values.java.util.Set<VMAAllocationCreateFlag>
flags()
int
hashCode()
Computes a hash code from attributes:flags
,usage
,requiredFlags
,preferredFlags
,memoryTypeBits
.long
memoryTypeBits()
static VMAAllocationCreateInfo
of(java.lang.Iterable<VMAAllocationCreateFlag> flags, VMAMemoryUsage usage, java.lang.Iterable<VulkanMemoryPropertyFlag> requiredFlags, java.lang.Iterable<VulkanMemoryPropertyFlag> preferredFlags, long memoryTypeBits)
Construct a new immutableVMAAllocationCreateInfo
instance.static VMAAllocationCreateInfo
of(java.util.Set<VMAAllocationCreateFlag> flags, VMAMemoryUsage usage, java.util.Set<VulkanMemoryPropertyFlag> requiredFlags, java.util.Set<VulkanMemoryPropertyFlag> preferredFlags, long memoryTypeBits)
Construct a new immutableVMAAllocationCreateInfo
instance.java.util.Set<VulkanMemoryPropertyFlag>
preferredFlags()
java.util.Set<VulkanMemoryPropertyFlag>
requiredFlags()
java.lang.String
toString()
Prints the immutable valueVMAAllocationCreateInfo
with attribute values.VMAMemoryUsage
usage()
VMAAllocationCreateInfo
withFlags(VMAAllocationCreateFlag... elements)
Copy the current immutable object with elements that replace the content offlags
.VMAAllocationCreateInfo
withFlags(java.lang.Iterable<VMAAllocationCreateFlag> elements)
Copy the current immutable object with elements that replace the content offlags
.VMAAllocationCreateInfo
withMemoryTypeBits(long value)
Copy the current immutable object by setting a value for thememoryTypeBits
attribute.VMAAllocationCreateInfo
withPreferredFlags(VulkanMemoryPropertyFlag... elements)
Copy the current immutable object with elements that replace the content ofpreferredFlags
.VMAAllocationCreateInfo
withPreferredFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> elements)
Copy the current immutable object with elements that replace the content ofpreferredFlags
.VMAAllocationCreateInfo
withRequiredFlags(VulkanMemoryPropertyFlag... elements)
Copy the current immutable object with elements that replace the content ofrequiredFlags
.VMAAllocationCreateInfo
withRequiredFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> elements)
Copy the current immutable object with elements that replace the content ofrequiredFlags
.VMAAllocationCreateInfo
withUsage(VMAMemoryUsage value)
Copy the current immutable object by setting a value for theusage
attribute.
-
-
-
Method Detail
-
flags
public java.util.Set<VMAAllocationCreateFlag> flags()
- Specified by:
flags
in interfaceVMAAllocationCreateInfoType
- Returns:
- The creation flags
-
usage
public VMAMemoryUsage usage()
- Specified by:
usage
in interfaceVMAAllocationCreateInfoType
- Returns:
- The intended usage of the memory allocation
-
requiredFlags
public java.util.Set<VulkanMemoryPropertyFlag> requiredFlags()
- Specified by:
requiredFlags
in interfaceVMAAllocationCreateInfoType
- Returns:
- The flags that must be set in a memory type chosen for an allocation.
-
preferredFlags
public java.util.Set<VulkanMemoryPropertyFlag> preferredFlags()
- Specified by:
preferredFlags
in interfaceVMAAllocationCreateInfoType
- Returns:
- The flags that preferably should be set in a memory type chosen for an allocation.
-
memoryTypeBits
public long memoryTypeBits()
- Specified by:
memoryTypeBits
in interfaceVMAAllocationCreateInfoType
- Returns:
- A bitmask containing one bit set for every memory type acceptable for this allocation.
-
withFlags
public final VMAAllocationCreateInfo withFlags(VMAAllocationCreateFlag... 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 VMAAllocationCreateInfo withFlags(java.lang.Iterable<VMAAllocationCreateFlag> 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
-
withUsage
public final VMAAllocationCreateInfo withUsage(VMAMemoryUsage value)
Copy the current immutable object by setting a value for theusage
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for usage- Returns:
- A modified copy of the
this
object
-
withRequiredFlags
public final VMAAllocationCreateInfo withRequiredFlags(VulkanMemoryPropertyFlag... elements)
Copy the current immutable object with elements that replace the content ofrequiredFlags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withRequiredFlags
public final VMAAllocationCreateInfo withRequiredFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> elements)
Copy the current immutable object with elements that replace the content ofrequiredFlags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of requiredFlags elements to set- Returns:
- A modified copy of
this
object
-
withPreferredFlags
public final VMAAllocationCreateInfo withPreferredFlags(VulkanMemoryPropertyFlag... elements)
Copy the current immutable object with elements that replace the content ofpreferredFlags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withPreferredFlags
public final VMAAllocationCreateInfo withPreferredFlags(java.lang.Iterable<VulkanMemoryPropertyFlag> elements)
Copy the current immutable object with elements that replace the content ofpreferredFlags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of preferredFlags elements to set- Returns:
- A modified copy of
this
object
-
withMemoryTypeBits
public final VMAAllocationCreateInfo withMemoryTypeBits(long 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 ofVMAAllocationCreateInfo
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:flags
,usage
,requiredFlags
,preferredFlags
,memoryTypeBits
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVMAAllocationCreateInfo
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VMAAllocationCreateInfo of(java.util.Set<VMAAllocationCreateFlag> flags, VMAMemoryUsage usage, java.util.Set<VulkanMemoryPropertyFlag> requiredFlags, java.util.Set<VulkanMemoryPropertyFlag> preferredFlags, long memoryTypeBits)
Construct a new immutableVMAAllocationCreateInfo
instance.- Parameters:
flags
- The value for theflags
attributeusage
- The value for theusage
attributerequiredFlags
- The value for therequiredFlags
attributepreferredFlags
- The value for thepreferredFlags
attributememoryTypeBits
- The value for thememoryTypeBits
attribute- Returns:
- An immutable VMAAllocationCreateInfo instance
-
of
public static VMAAllocationCreateInfo of(java.lang.Iterable<VMAAllocationCreateFlag> flags, VMAMemoryUsage usage, java.lang.Iterable<VulkanMemoryPropertyFlag> requiredFlags, java.lang.Iterable<VulkanMemoryPropertyFlag> preferredFlags, long memoryTypeBits)
Construct a new immutableVMAAllocationCreateInfo
instance.- Parameters:
flags
- The value for theflags
attributeusage
- The value for theusage
attributerequiredFlags
- The value for therequiredFlags
attributepreferredFlags
- The value for thepreferredFlags
attributememoryTypeBits
- The value for thememoryTypeBits
attribute- Returns:
- An immutable VMAAllocationCreateInfo instance
-
copyOf
public static VMAAllocationCreateInfo copyOf(VMAAllocationCreateInfoType instance)
Creates an immutable copy of aVMAAllocationCreateInfoType
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 VMAAllocationCreateInfo instance
-
builder
public static VMAAllocationCreateInfo.Builder builder()
Creates a builder forVMAAllocationCreateInfo
.- Returns:
- A new VMAAllocationCreateInfo builder
-
-