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

Add convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of serializeAll() #3819

Merged
merged 5 commits into from
Mar 11, 2023

Conversation

JooHyukKim
Copy link
Member

@JooHyukKim JooHyukKim commented Mar 10, 2023

Description

This PR adds a new convenience method to SimpleBeanPropertyFilter class, called filterOutAll(). The purpose of this method is to provide a symmetric counterpart to the already-existing serializeAll(), making it easier for developers to use SimpleBeanPropertyFilter class in a more intuitive way.

Changes Made

  • Implemented the filterOutAll() method in SimpleBeanPropertyFilter.
  • Added test cases for all possible filterOutAllExcept(String...) and serializeAllExcept(String...) methods of SimpleBeanPropertyFilter and its subclasses to ensure that they output the same JSON string.

@JooHyukKim JooHyukKim changed the title Feature : add filterOutAll() method, symmetric counterpart to serializeAll() for SimpleBeanPropertyFilter Feature : convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of SimpleBeanPropertyFilter. serializeAll() Mar 11, 2023
@JooHyukKim JooHyukKim changed the title Feature : convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of SimpleBeanPropertyFilter. serializeAll() Feature : convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of serializeAll() Mar 11, 2023
SimpleBeanPropertyFilter.filterOutAll());
assertEquals("{}", MAPPER.writer(prov).writeValueAsString(new Bean()));
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is testIncludeAllFilter() test right above this one. So this test case seems to belong here.

@cowtowncoder cowtowncoder merged commit 119addc into FasterXML:2.15 Mar 11, 2023
@cowtowncoder cowtowncoder changed the title Feature : convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of serializeAll() Add convenience method SimpleBeanPropertyFilter.filterOutAll() as symmetric counterpart of serializeAll() Mar 11, 2023
@cowtowncoder cowtowncoder added this to the 2.15.0 milestone Mar 11, 2023
cowtowncoder added a commit that referenced this pull request Mar 11, 2023
@JooHyukKim JooHyukKim deleted the Test-untested-methods branch May 22, 2023 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants