Class VMAAllocationResult<T>
java.lang.Object
com.io7m.jcoronado.vma.VMAAllocationResult<T>
- Type Parameters:
T- The type of allocation result
- All Implemented Interfaces:
VMAAllocationResultType<T>
An allocation result.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeVMAAllocationResult. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> VMAAllocationResult.Builder<T> builder()Creates a builder forVMAAllocationResult.static <T> VMAAllocationResult<T> copyOf(VMAAllocationResultType<T> instance) Creates an immutable copy of aVMAAllocationResultTypevalue.booleanThis instance is equal to all instances ofVMAAllocationResultthat have equal attribute values.inthashCode()Computes a hash code from attributes:allocation,result.static <T> VMAAllocationResult<T> of(VMAAllocationType allocation, T result) Construct a new immutableVMAAllocationResultinstance.result()toString()Prints the immutable valueVMAAllocationResultwith attribute values.final VMAAllocationResult<T> withAllocation(VMAAllocationType value) Copy the current immutable object by setting a value for theallocationattribute.final VMAAllocationResult<T> withResult(T value) Copy the current immutable object by setting a value for theresultattribute.
-
Method Details
-
allocation
- Specified by:
allocationin interfaceVMAAllocationResultType<T>- Returns:
- The allocation
-
result
- Specified by:
resultin interfaceVMAAllocationResultType<T>- Returns:
- The allocation result. Typically an image or a buffer.
-
withAllocation
Copy the current immutable object by setting a value for theallocationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for allocation- Returns:
- A modified copy or the
thisobject
-
withResult
Copy the current immutable object by setting a value for theresultattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for result- Returns:
- A modified copy or the
thisobject
-
equals
-
hashCode
-
toString
-
of
Construct a new immutableVMAAllocationResultinstance.- Type Parameters:
T- generic parameter T- Parameters:
allocation- The value for theallocationattributeresult- The value for theresultattribute- Returns:
- An immutable VMAAllocationResult instance
-
copyOf
Creates an immutable copy of aVMAAllocationResultTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
T- generic parameter T- Parameters:
instance- The instance to copy- Returns:
- A copied immutable VMAAllocationResult instance
-
builder
Creates a builder forVMAAllocationResult.VMAAllocationResult.<T>builder() .setAllocation(com.io7m.jcoronado.vma.VMAAllocationType) // required
allocation.setResult(T) // requiredresult.build();- Type Parameters:
T- generic parameter T- Returns:
- A new VMAAllocationResult builder
-