This repository has been archived by the owner on Nov 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6116294
commit 9dcba51
Showing
43 changed files
with
822 additions
and
715 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
83 changes: 0 additions & 83 deletions
83
...tydb-eql/eql-filters/src/main/java/ai/idylnlp/eql/filters/comparisons/DateComparison.java
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
entitydb-eql/eql-filters/src/main/java/ai/philterd/entitydb/eql/filters/DateComparison.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,73 @@ | ||
/* | ||
* Copyright 2024 Philterd, LLC | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package ai.philterd.entitydb.eql.filters; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
public enum DateComparison { | ||
|
||
BEFORE("before"), AFTER("after"); | ||
|
||
private String dateComparison; | ||
|
||
private DateComparison(String dateComparison) { | ||
|
||
this.dateComparison = dateComparison; | ||
|
||
} | ||
|
||
/** | ||
* Gets the enumeration from a string value. | ||
* @param dateComparison The value to look up. | ||
* @return A {@link DateComparison comparison}. | ||
*/ | ||
public static DateComparison fromValue(String dateComparison) { | ||
|
||
if(StringUtils.isNotEmpty(dateComparison)) { | ||
|
||
for (DateComparison d : DateComparison.values()) { | ||
|
||
if (dateComparison.equalsIgnoreCase(d.getDateComparison())) { | ||
return d; | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
throw new IllegalArgumentException("No date comparison found with value: " + dateComparison); | ||
|
||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
||
return dateComparison; | ||
|
||
} | ||
|
||
public String getDateComparison() { | ||
|
||
return dateComparison; | ||
|
||
} | ||
|
||
} |
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.