Skip to content

Commit

Permalink
[#17] Unified and reworked api of fluent element validator and filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasstamann committed Feb 23, 2018
1 parent 904caf2 commit 8fd9b8e
Show file tree
Hide file tree
Showing 3 changed files with 557 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public FluentElementFilter<ELEMENT> filterByAllOf(CHARACTERISTIC... criteria) {
* @param coreMatcher the implicit core matcher to use
* @return the FluentElementFilter instance
*/
public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> applyFilter(IsCoreMatcher<ELEMENT, TARGET_ELEMENT> coreMatcher) {
public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> is(IsCoreMatcher<ELEMENT, TARGET_ELEMENT> coreMatcher) {

elements = coreMatcher.getFilter().filter(elements);
return new FluentElementFilter<TARGET_ELEMENT>((List<TARGET_ELEMENT>) elements);
Expand All @@ -173,7 +173,7 @@ public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> appl
* @param coreMatcher the implicit core matcher to use
* @return the FluentElementFilter instance
*/
public <TARGET_ELEMENT extends Element> FluentElementFilter<ELEMENT> applyInvertedFilter(IsCoreMatcher<ELEMENT, TARGET_ELEMENT> coreMatcher) {
public <TARGET_ELEMENT extends Element> FluentElementFilter<ELEMENT> isNot(IsCoreMatcher<ELEMENT, TARGET_ELEMENT> coreMatcher) {

elements = coreMatcher.getFilter().filter(elements, true);
return FluentElementFilter.this;
Expand All @@ -187,7 +187,7 @@ public <TARGET_ELEMENT extends Element> FluentElementFilter<ELEMENT> applyInvert
* @param coreMatcher the implicit core matcher to use
* @return the FluentElementFilter instance
*/
public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> applyFilter(IsElementBasedCoreMatcher<TARGET_ELEMENT> coreMatcher) {
public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> is(IsElementBasedCoreMatcher<TARGET_ELEMENT> coreMatcher) {

elements = (List<ELEMENT>) coreMatcher.getFilter().filter((List<Element>) elements);
return new FluentElementFilter<TARGET_ELEMENT>((List<TARGET_ELEMENT>) elements);
Expand All @@ -200,7 +200,7 @@ public <TARGET_ELEMENT extends Element> FluentElementFilter<TARGET_ELEMENT> appl
* @param coreMatcher the implicit core matcher to use
* @return the FluentElementFilter instance
*/
public <TARGET_ELEMENT extends Element> FluentElementFilter<ELEMENT> applyInvertedFilter(IsElementBasedCoreMatcher<TARGET_ELEMENT> coreMatcher) {
public <TARGET_ELEMENT extends Element> FluentElementFilter<ELEMENT> isNot(IsElementBasedCoreMatcher<TARGET_ELEMENT> coreMatcher) {

elements = (List<ELEMENT>) coreMatcher.getFilter().filter((List<Element>) elements, true);
return FluentElementFilter.this;
Expand Down
Loading

0 comments on commit 8fd9b8e

Please sign in to comment.