Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ifSuccessfulOrElse (0.12 sec)

  1. platforms/core-runtime/functional/src/test/groovy/org/gradle/internal/TryTest.groovy

            when:
            Try.successful(value).ifSuccessfulOrElse({ successInvoked = true; assert it == value }, { assert false })
            then:
            successInvoked
        }
    
        def "failed or else processes failure"() {
            def failure = new RuntimeException("failure")
            boolean failureInvoked = false
            when:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:10:49 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. platforms/core-runtime/functional/src/main/java/org/gradle/internal/Try.java

        /**
         * Calls {successConsumer} with the result if the represented operation was successful,
         * otherwise calls {failureConsumer} with the failure.
         */
        public abstract void ifSuccessfulOrElse(Consumer<? super T> successConsumer, Consumer<? super Throwable> failureConsumer);
    
        private static final class Success<T> extends Try<T> {
            private final T value;
    
            public Success(T value) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 18 08:10:49 UTC 2024
    - 10.3K bytes
    - Viewed (0)
Back to top