October 21, 2024
Chicago 12, Melborne City, USA
java

How to flip error with no-error with projectreactor in Java?


I have instance of Mono<MyClass1>

It can either have value or be an error. Now I need to convert it to Mono<MyClass2> where error and no-error flipped

mono
   .doMagic( $ -> {
      if( error ) {
         return Mono.just( new MyClass2 .. )
      }
      else if( no-error ) {
         return Mono.error(...)
      }

   }

Is this possible?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video