Package com.io7m.jwheatsheaf.ui.internal
Class JWFileChoosersTesting
java.lang.Object
com.io7m.jwheatsheaf.ui.internal.JWFileChoosersTesting
- All Implemented Interfaces:
JWFileChoosersTestingType
public final class JWFileChoosersTesting extends java.lang.Object implements JWFileChoosersTestingType
Configuration parameters useful for testing this chooser implementation.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JWFileChoosersTesting.Builder
Builds instances of typeJWFileChoosersTesting
. -
Method Summary
Modifier and Type Method Description static JWFileChoosersTesting.Builder
builder()
Creates a builder forJWFileChoosersTesting
.static JWFileChoosersTesting
copyOf(JWFileChoosersTestingType instance)
Creates an immutable copy of aJWFileChoosersTestingType
value.boolean
equals(java.lang.Object another)
This instance is equal to all instances ofJWFileChoosersTesting
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:ioDelay
.java.util.Optional<java.time.Duration>
ioDelay()
java.lang.String
toString()
Prints the immutable valueJWFileChoosersTesting
with attribute values.JWFileChoosersTesting
withIoDelay(java.time.Duration value)
Copy the current immutable object by setting a present value for the optionalioDelay
attribute.JWFileChoosersTesting
withIoDelay(java.util.Optional<? extends java.time.Duration> optional)
Copy the current immutable object by setting an optional value for theioDelay
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
ioDelay
public java.util.Optional<java.time.Duration> ioDelay()- Specified by:
ioDelay
in interfaceJWFileChoosersTestingType
- Returns:
- A delay added to I/O operations to test how the UI responds to slow I/O.
-
withIoDelay
Copy the current immutable object by setting a present value for the optionalioDelay
attribute.- Parameters:
value
- The value for ioDelay- Returns:
- A modified copy of
this
object
-
withIoDelay
public final JWFileChoosersTesting withIoDelay(java.util.Optional<? extends java.time.Duration> optional)Copy the current immutable object by setting an optional value for theioDelay
attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for ioDelay- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofJWFileChoosersTesting
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:ioDelay
.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueJWFileChoosersTesting
with attribute values.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aJWFileChoosersTestingType
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 JWFileChoosersTesting instance
-
builder
Creates a builder forJWFileChoosersTesting
.JWFileChoosersTesting.builder() .setIoDelay(java.time.Duration) // optional
ioDelay
.build();- Returns:
- A new JWFileChoosersTesting builder
-