GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Exclude default Methods from Auto-Generated Mapper Implementation · Issue #3838 · mapstruct/mapstruct

Exclude default Methods from Auto-Generated Mapper Implementation #3838

New issue
Copy link
New issue
Copy link
Closed
Closed
Exclude default Methods from Auto-Generated Mapper Implementation#3838
Copy link

Description

@destiny3912
destiny3912
opened on Apr 3, 2025
Issue body actions

Use case

  • I want to define default methods in a mapper interface, but they should only be used when the mapper is called externally. They should not be used within the auto-generated mapper implementation.

  • I think it would be helpful to have an annotation that can be applied to default methods, ensuring they cannot be used by the auto-generated mapper implementation.

Generated Code

No response

Possible workarounds

No response

MapStruct Version

No response

Activity

  1. filiphr commented on Apr 4, 2025

    @filiphr
    filiphr
    on Apr 4, 2025
    Member
    More actions

    There is already such an annotation @destiny3912. You can use @Named on those methods and then MapStruct will only use them when you use qualifiedByName.

    Can you please check whether that satisfies your use case?

  2. destiny3912 commented on Apr 9, 2025

    @destiny3912
    destiny3912
    on Apr 9, 2025
    Author
    More actions

    @filiphr I checked my use case. Then I can use @Named Annotation for my use case. Thank You for advice

  3. destiny3912
    closed this as completedon Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.