-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to auto match via student service
- Loading branch information
1 parent
2d0f158
commit 504e98f
Showing
14 changed files
with
427 additions
and
274 deletions.
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
api/src/main/java/ca/bc/gov/educ/api/soam/filter/FilterOperation.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,100 @@ | ||
package ca.bc.gov.educ.api.soam.filter; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
|
||
import java.util.Optional; | ||
|
||
/** | ||
* The enum Filter operation. | ||
*/ | ||
public enum FilterOperation { | ||
|
||
/** | ||
* Equal filter operation. | ||
*/ | ||
EQUAL("eq"), | ||
/** | ||
* Not equal filter operation. | ||
*/ | ||
NOT_EQUAL("neq"), | ||
/** | ||
* Greater than filter operation. | ||
*/ | ||
GREATER_THAN("gt"), | ||
/** | ||
* Greater than or equal to filter operation. | ||
*/ | ||
GREATER_THAN_OR_EQUAL_TO("gte"), | ||
/** | ||
* Less than filter operation. | ||
*/ | ||
LESS_THAN("lt"), | ||
/** | ||
* Less than or equal to filter operation. | ||
*/ | ||
LESS_THAN_OR_EQUAL_TO("lte"), | ||
/** | ||
* In filter operation. | ||
*/ | ||
IN("in"), | ||
/** | ||
* Not in filter operation. | ||
*/ | ||
NOT_IN("nin"), | ||
/** | ||
* Between filter operation. | ||
*/ | ||
BETWEEN("btn"), | ||
/** | ||
* Contains filter operation. | ||
*/ | ||
CONTAINS("like"), | ||
/** | ||
* Contains ignore case filter operation. | ||
*/ | ||
CONTAINS_IGNORE_CASE("like_ignore_case"), | ||
/** | ||
* Starts with filter operation. | ||
*/ | ||
STARTS_WITH("starts_with"), | ||
/** | ||
* Starts with ignore case filter operation. | ||
*/ | ||
STARTS_WITH_IGNORE_CASE("starts_with_ignore_case"); | ||
|
||
/** | ||
* The Value. | ||
*/ | ||
private final String value; | ||
|
||
/** | ||
* Instantiates a new Filter operation. | ||
* | ||
* @param value the value | ||
*/ | ||
FilterOperation(String value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* From value optional. | ||
* | ||
* @param value the value | ||
* @return the optional | ||
*/ | ||
public static Optional<FilterOperation> fromValue(String value) { | ||
for (FilterOperation op : FilterOperation.values()) { | ||
if (String.valueOf(op.value).equalsIgnoreCase(value)) { | ||
return Optional.of(op); | ||
} | ||
} | ||
return Optional.empty(); | ||
} | ||
|
||
@Override | ||
@JsonValue | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
} |
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.