Package io.klib.swtbot.support
Record Class CaptureResult
java.lang.Object
java.lang.Record
io.klib.swtbot.support.CaptureResult
- Record Components:
status- capture outcomemode- requested capture regionoutputPath- completed PNG path, or null when no artifact was producedwidth- captured width in pixels, zero for unsuccessful library resultsheight- captured height in pixels, zero for unsuccessful library resultsreason- human-readable outcome explanationcause- underlying failure, or null when none is available
public record CaptureResult(CaptureResult.Status status, CaptureMode mode, Path outputPath, int width, int height, String reason, Throwable cause)
extends Record
Capture outcome; no constructor validation is performed on caller-created results.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether evidence was written, unavailable, or failed during capture. -
Constructor Summary
ConstructorsConstructorDescriptionCaptureResult(CaptureResult.Status status, CaptureMode mode, Path outputPath, int width, int height, String reason, Throwable cause) Creates an instance of aCaptureResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.mode()Returns the value of themoderecord component.Returns the value of theoutputPathrecord component.reason()Returns the value of thereasonrecord component.Requires actual evidence rather than treating skipped capture as success.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
CaptureResult
public CaptureResult(CaptureResult.Status status, CaptureMode mode, Path outputPath, int width, int height, String reason, Throwable cause) Creates an instance of aCaptureResultrecord class.- Parameters:
status- the value for thestatusrecord componentmode- the value for themoderecord componentoutputPath- the value for theoutputPathrecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentreason- the value for thereasonrecord componentcause- the value for thecauserecord component
-
-
Method Details
-
requireCaptured
Requires actual evidence rather than treating skipped capture as success.- Returns:
- this result when captured
- Throws:
IllegalStateException- if status is notCaptureResult.Status.CAPTURED, retaining the cause
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
outputPath
Returns the value of theoutputPathrecord component.- Returns:
- the value of the
outputPathrecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-