Skip to content

Adapter - Messaging - RabbitMQ - Pattern Matching for instanceof #119

@valentinajemuovic

Description

@valentinajemuovic
          @eamtalu, you can use the feature "Pattern Matching for instanceof" (JEP 394) here, so you won't need to make the casting, following the example and documentation:
if (eventDto instanceof AccountOpenedDto accountOpenedDto) {
    System.out.println(accountOpenedDto);
}

doc: https://docs.oracle.com/en/java/javase/17/language/pattern-matching-instanceof-operator.html

Originally posted by @JoaoCipriano in #117 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions