-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from sidhant92/develop
Support for Array operations
- Loading branch information
Showing
36 changed files
with
1,052 additions
and
316 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -9,5 +9,6 @@ public enum NodeType { | |
COMPARISON, | ||
NUMERIC_RANGE, | ||
IN, | ||
ARRAY, | ||
UNARY | ||
} |
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
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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/github/sidhant92/boolparser/domain/ArrayNode.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,27 @@ | ||
package com.github.sidhant92.boolparser.domain; | ||
|
||
import java.util.List; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
import com.github.sidhant92.boolparser.constant.DataType; | ||
import com.github.sidhant92.boolparser.constant.NodeType; | ||
import com.github.sidhant92.boolparser.constant.Operator; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
@Setter | ||
@Builder | ||
public class ArrayNode extends Node { | ||
private final String field; | ||
|
||
private final Operator operator; | ||
|
||
private final List<Pair<DataType, Object>> items; | ||
@Override | ||
public NodeType getTokenType() { | ||
return NodeType.ARRAY; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/github/sidhant92/boolparser/exception/HeterogeneousArrayException.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,8 @@ | ||
package com.github.sidhant92.boolparser.exception; | ||
|
||
public class HeterogeneousArrayException extends RuntimeException{ | ||
@Override | ||
public String getMessage() { | ||
return "Heterogeneous input of array not allowed"; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/github/sidhant92/boolparser/exception/InvalidContainerTypeException.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,16 @@ | ||
package com.github.sidhant92.boolparser.exception; | ||
|
||
public class InvalidContainerTypeException extends RuntimeException { | ||
public InvalidContainerTypeException(final String message) { | ||
super(message); | ||
} | ||
|
||
public InvalidContainerTypeException() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return "Invalid Container Type"; | ||
} | ||
} |
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.