- java.lang.Object
-
- com.io7m.jcoronado.api.VulkanBufferCreateInfo
-
- All Implemented Interfaces:
VulkanBufferCreateInfoType
public final class VulkanBufferCreateInfo extends java.lang.Object implements VulkanBufferCreateInfoType
Information required to create a buffer.- See Also:
- "VkBufferCreateInfo"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VulkanBufferCreateInfo.Builder
Builds instances of typeVulkanBufferCreateInfo
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VulkanBufferCreateInfo.Builder
builder()
Creates a builder forVulkanBufferCreateInfo
.static VulkanBufferCreateInfo
copyOf(VulkanBufferCreateInfoType instance)
Creates an immutable copy of aVulkanBufferCreateInfoType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofVulkanBufferCreateInfo
that have equal attribute values.java.util.Set<VulkanBufferCreateFlag>
flags()
int
hashCode()
Computes a hash code from attributes:flags
,size
,usageFlags
,sharingMode
,queueFamilyIndices
.static VulkanBufferCreateInfo
of(java.lang.Iterable<VulkanBufferCreateFlag> flags, long size, java.lang.Iterable<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, java.lang.Iterable<java.lang.Integer> queueFamilyIndices)
Construct a new immutableVulkanBufferCreateInfo
instance.static VulkanBufferCreateInfo
of(java.util.Set<VulkanBufferCreateFlag> flags, long size, java.util.Set<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, java.util.List<java.lang.Integer> queueFamilyIndices)
Construct a new immutableVulkanBufferCreateInfo
instance.java.util.List<java.lang.Integer>
queueFamilyIndices()
VulkanSharingMode
sharingMode()
long
size()
java.lang.String
toString()
Prints the immutable valueVulkanBufferCreateInfo
with attribute values.java.util.Set<VulkanBufferUsageFlag>
usageFlags()
VulkanBufferCreateInfo
withFlags(VulkanBufferCreateFlag... elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanBufferCreateInfo
withFlags(java.lang.Iterable<VulkanBufferCreateFlag> elements)
Copy the current immutable object with elements that replace the content offlags
.VulkanBufferCreateInfo
withQueueFamilyIndices(int... elements)
Copy the current immutable object with elements that replace the content ofqueueFamilyIndices
.VulkanBufferCreateInfo
withQueueFamilyIndices(java.lang.Iterable<java.lang.Integer> elements)
Copy the current immutable object with elements that replace the content ofqueueFamilyIndices
.VulkanBufferCreateInfo
withSharingMode(VulkanSharingMode value)
Copy the current immutable object by setting a value for thesharingMode
attribute.VulkanBufferCreateInfo
withSize(long value)
Copy the current immutable object by setting a value for thesize
attribute.VulkanBufferCreateInfo
withUsageFlags(VulkanBufferUsageFlag... elements)
Copy the current immutable object with elements that replace the content ofusageFlags
.VulkanBufferCreateInfo
withUsageFlags(java.lang.Iterable<VulkanBufferUsageFlag> elements)
Copy the current immutable object with elements that replace the content ofusageFlags
.
-
-
-
Method Detail
-
flags
public java.util.Set<VulkanBufferCreateFlag> flags()
- Specified by:
flags
in interfaceVulkanBufferCreateInfoType
- Returns:
- A bitmask of VkBufferCreateFlagBits specifying additional parameters of the buffer.
-
size
public long size()
- Specified by:
size
in interfaceVulkanBufferCreateInfoType
- Returns:
- The size in bytes of the buffer to be created.
-
usageFlags
public java.util.Set<VulkanBufferUsageFlag> usageFlags()
- Specified by:
usageFlags
in interfaceVulkanBufferCreateInfoType
- Returns:
- A bitmask of VkBufferUsageFlagBits specifying allowed usages of the buffer.
-
sharingMode
public VulkanSharingMode sharingMode()
- Specified by:
sharingMode
in interfaceVulkanBufferCreateInfoType
- Returns:
- A VkSharingMode value specifying the sharing mode of the buffer when it will be accessed by multiple queue families.
-
queueFamilyIndices
public java.util.List<java.lang.Integer> queueFamilyIndices()
- Specified by:
queueFamilyIndices
in interfaceVulkanBufferCreateInfoType
- Returns:
- A list of queue families that will access this buffer (ignored if sharingMode is not VK_SHARING_MODE_CONCURRENT).
-
withFlags
public final VulkanBufferCreateInfo withFlags(VulkanBufferCreateFlag... 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 VulkanBufferCreateInfo withFlags(java.lang.Iterable<VulkanBufferCreateFlag> 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
-
withSize
public final VulkanBufferCreateInfo 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
-
withUsageFlags
public final VulkanBufferCreateInfo withUsageFlags(VulkanBufferUsageFlag... elements)
Copy the current immutable object with elements that replace the content ofusageFlags
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withUsageFlags
public final VulkanBufferCreateInfo withUsageFlags(java.lang.Iterable<VulkanBufferUsageFlag> elements)
Copy the current immutable object with elements that replace the content ofusageFlags
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of usageFlags elements to set- Returns:
- A modified copy of
this
object
-
withSharingMode
public final VulkanBufferCreateInfo withSharingMode(VulkanSharingMode value)
Copy the current immutable object by setting a value for thesharingMode
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for sharingMode- Returns:
- A modified copy of the
this
object
-
withQueueFamilyIndices
public final VulkanBufferCreateInfo withQueueFamilyIndices(int... elements)
Copy the current immutable object with elements that replace the content ofqueueFamilyIndices
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withQueueFamilyIndices
public final VulkanBufferCreateInfo withQueueFamilyIndices(java.lang.Iterable<java.lang.Integer> elements)
Copy the current immutable object with elements that replace the content ofqueueFamilyIndices
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of queueFamilyIndices 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 ofVulkanBufferCreateInfo
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
,size
,usageFlags
,sharingMode
,queueFamilyIndices
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueVulkanBufferCreateInfo
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
of
public static VulkanBufferCreateInfo of(java.util.Set<VulkanBufferCreateFlag> flags, long size, java.util.Set<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, java.util.List<java.lang.Integer> queueFamilyIndices)
Construct a new immutableVulkanBufferCreateInfo
instance.- Parameters:
flags
- The value for theflags
attributesize
- The value for thesize
attributeusageFlags
- The value for theusageFlags
attributesharingMode
- The value for thesharingMode
attributequeueFamilyIndices
- The value for thequeueFamilyIndices
attribute- Returns:
- An immutable VulkanBufferCreateInfo instance
-
of
public static VulkanBufferCreateInfo of(java.lang.Iterable<VulkanBufferCreateFlag> flags, long size, java.lang.Iterable<VulkanBufferUsageFlag> usageFlags, VulkanSharingMode sharingMode, java.lang.Iterable<java.lang.Integer> queueFamilyIndices)
Construct a new immutableVulkanBufferCreateInfo
instance.- Parameters:
flags
- The value for theflags
attributesize
- The value for thesize
attributeusageFlags
- The value for theusageFlags
attributesharingMode
- The value for thesharingMode
attributequeueFamilyIndices
- The value for thequeueFamilyIndices
attribute- Returns:
- An immutable VulkanBufferCreateInfo instance
-
copyOf
public static VulkanBufferCreateInfo copyOf(VulkanBufferCreateInfoType instance)
Creates an immutable copy of aVulkanBufferCreateInfoType
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 VulkanBufferCreateInfo instance
-
builder
public static VulkanBufferCreateInfo.Builder builder()
Creates a builder forVulkanBufferCreateInfo
.- Returns:
- A new VulkanBufferCreateInfo builder
-
-