-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor walkers * unit tests for conditions, replace null assignment in ElementCondition, primary constructor for IndexStatementCondition explanatory comments for LatestCondition and EarliestCondition * cleanup walker conditions tests * use DSL condition instead of Optional, add invalid element name tests * conditions equality tests * add an override for equals() in walker conditions * add equal pointer check for equals methods for conditions, separate equals and notEquals tests * conditions use String parameters instead of getting them from Element class, refactor tests * add javadoc for IndexStatementCondition equals method * add symmetric equality check and null object equality check * fix IndexCondition equals method * remove unnecessary comment
- Loading branch information
Showing
20 changed files
with
1,370 additions
and
245 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/main/java/com/teragrep/pth_06/config/ConditionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.teragrep.pth_06.config; | ||
|
||
import com.teragrep.pth_06.planner.walker.conditions.ElementCondition; | ||
import org.jooq.DSLContext; | ||
|
||
public final class ConditionConfig { | ||
private final DSLContext ctx; | ||
private final boolean streamQuery; | ||
private final boolean bloomEnabled; | ||
private final boolean withoutFilters; | ||
|
||
public ConditionConfig(DSLContext ctx, boolean streamQuery) { | ||
this.ctx = ctx; | ||
this.streamQuery = streamQuery; | ||
this.bloomEnabled = false; | ||
this.withoutFilters = false; | ||
} | ||
|
||
public ConditionConfig(DSLContext ctx, boolean streamQuery, boolean bloomEnabled, boolean withoutFilters) { | ||
this.ctx = ctx; | ||
this.streamQuery = streamQuery; | ||
this.bloomEnabled = bloomEnabled; | ||
this.withoutFilters = withoutFilters; | ||
} | ||
|
||
public DSLContext context() { | ||
return ctx; | ||
} | ||
|
||
public boolean bloomEnabled() { | ||
return bloomEnabled; | ||
} | ||
|
||
public boolean streamQuery() { | ||
return streamQuery; | ||
} | ||
|
||
public boolean withoutFilter() { | ||
return withoutFilters; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
if (this == object) return true; | ||
if (object == null) return false; | ||
if (object.getClass() != this.getClass()) return false; | ||
final ConditionConfig cast = (ConditionConfig) object; | ||
return this.bloomEnabled == cast.bloomEnabled && | ||
this.streamQuery == cast.streamQuery && | ||
this.withoutFilters == cast.withoutFilters && | ||
this.ctx == cast.ctx; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.