Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify ignore missing to support ignore missing fields in source bean and/or destination bean #46

Closed
slemesle opened this issue Nov 28, 2014 · 0 comments
Milestone

Comments

@slemesle
Copy link

User should be able to ignore fields from source bean or from destination bean separately.

Introduce an IgnoreMissing enum:

public enum IgnoreMissing {
    /**
     * Ignore fields appearing in destination and missing in source bean.
     */
    SOURCE,

    /**
     * Ignore fields appearing in source and missing in destination bean.
     */
    DESTINATION,

    /**
     * Ignore all missing fields from source and destination bean
     */
    ALL,

    /**
     * Report all missing fields from source and destination bean
     */
    NONE,

    /**
     * If setted on {@link @Maps} then {@link @Mapper} setting is applied otherwise {@code NONE} is applied.
     */
    DEFAULT;
}

This enum can be used in @Mapper and @Maps using the withIgnoreMissing parameter.

With this new behavior Selma will allow to map a DTO containing a subset of the fields appearing in the source bean and reverse.

This deprecates the old ignoreMissingProperties parameter.

@slemesle slemesle added this to the 0.10 milestone Nov 28, 2014
slemesle added a commit that referenced this issue Nov 28, 2014
slemesle added a commit that referenced this issue Nov 29, 2014
@slemesle slemesle closed this as completed Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant