Class JWFileChoosersTesting

java.lang.Object
com.io7m.jwheatsheaf.ui.internal.JWFileChoosersTesting
All Implemented Interfaces:
JWFileChoosersTestingType

public final class JWFileChoosersTesting extends Object implements JWFileChoosersTestingType
Configuration parameters useful for testing this chooser implementation.
  • Method Details

    • ioDelay

      public Optional<Duration> ioDelay()
      Specified by:
      ioDelay in interface JWFileChoosersTestingType
      Returns:
      A delay added to I/O operations to test how the UI responds to slow I/O.
    • withIoDelay

      public final JWFileChoosersTesting withIoDelay(Duration value)
      Copy the current immutable object by setting a present value for the optional ioDelay attribute.
      Parameters:
      value - The value for ioDelay
      Returns:
      A modified copy of this object
    • withIoDelay

      public final JWFileChoosersTesting withIoDelay(Optional<? extends Duration> optional)
      Copy the current immutable object by setting an optional value for the ioDelay attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ioDelay
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of JWFileChoosersTesting that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: ioDelay.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value JWFileChoosersTesting with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static JWFileChoosersTesting copyOf(JWFileChoosersTestingType instance)
      Creates an immutable copy of a JWFileChoosersTestingType 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

      public static JWFileChoosersTesting.Builder builder()
      Creates a builder for JWFileChoosersTesting.
       JWFileChoosersTesting.builder()
          .setIoDelay(java.time.Duration) // optional ioDelay
          .build();
       
      Returns:
      A new JWFileChoosersTesting builder