-
Notifications
You must be signed in to change notification settings - Fork 0
DOPE-176: add missing Token functions and expressions for token handling #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
847f270
DOPE-176: add missing Token functions and expressions for token handling
jansigi aa66586
DOPE-176: reorganize token-related classes and update function signat…
jansigi 0119ae3
Merge branch 'main' into feature/DOPE-176-token-functions
jansigi 797c207
DOPE-176: implement retry mechanism for index creation in CouchbaseDa…
jansigi e06bbb0
DOPE-176: rename ContainsTokenOptions fields for clarity and consistency
jansigi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
.../main/kotlin/ch/ergon/dope/resolvable/expression/type/function/string/TokensExpression.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...rc/main/kotlin/ch/ergon/dope/resolvable/expression/type/function/string/factory/Tokens.kt
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...kotlin/ch/ergon/dope/resolvable/expression/type/function/token/ContainsTokenExpression.kt
This file contains hidden or 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,23 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.expression.operator.FunctionOperator | ||
| import ch.ergon.dope.resolvable.expression.type.TypeExpression | ||
| import ch.ergon.dope.resolvable.expression.type.toDopeType | ||
| import ch.ergon.dope.validtype.BooleanType | ||
| import ch.ergon.dope.validtype.StringType | ||
|
|
||
| data class ContainsTokenExpression( | ||
| val inputExpression: TypeExpression<StringType>, | ||
| val tokenExpression: TypeExpression<StringType>, | ||
| val tokenOptions: ContainsTokenOptions? = null, | ||
| ) : FunctionOperator<BooleanType> | ||
|
|
||
| fun TypeExpression<StringType>.containsToken( | ||
| tokenExpression: TypeExpression<StringType>, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = ContainsTokenExpression(this, tokenExpression, tokenOptions) | ||
|
|
||
| fun TypeExpression<StringType>.containsToken( | ||
| token: String, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = containsToken(token.toDopeType(), tokenOptions) | ||
24 changes: 24 additions & 0 deletions
24
...in/ch/ergon/dope/resolvable/expression/type/function/token/ContainsTokenLikeExpression.kt
This file contains hidden or 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,24 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.expression.operator.FunctionOperator | ||
| import ch.ergon.dope.resolvable.expression.type.TypeExpression | ||
| import ch.ergon.dope.resolvable.expression.type.toDopeType | ||
| import ch.ergon.dope.validtype.BooleanType | ||
| import ch.ergon.dope.validtype.StringType | ||
| import ch.ergon.dope.validtype.ValidType | ||
|
|
||
| data class ContainsTokenLikeExpression( | ||
| val inputObject: TypeExpression<out ValidType>, | ||
| val likeExpression: TypeExpression<StringType>, | ||
| val tokenOptions: ContainsTokenOptions? = null, | ||
| ) : FunctionOperator<BooleanType> | ||
|
|
||
| fun TypeExpression<out ValidType>.containsTokenLike( | ||
| likeExpression: TypeExpression<StringType>, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = ContainsTokenLikeExpression(this, likeExpression, tokenOptions) | ||
|
|
||
| fun TypeExpression<out ValidType>.containsTokenLike( | ||
|
jansigi marked this conversation as resolved.
|
||
| likeExpression: String, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = containsTokenLike(likeExpression.toDopeType(), tokenOptions) | ||
19 changes: 19 additions & 0 deletions
19
...in/kotlin/ch/ergon/dope/resolvable/expression/type/function/token/ContainsTokenOptions.kt
This file contains hidden or 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,19 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.Resolvable | ||
|
|
||
| data class ContainsTokenOptions( | ||
| val hasNames: Boolean? = null, | ||
| val case: TokenCase? = null, | ||
| val includeSpecialCharacters: Boolean? = null, | ||
| val split: Boolean? = null, | ||
| val trim: Boolean? = null, | ||
| ) : Resolvable | ||
|
|
||
| fun containsTokenOptions( | ||
| hasNames: Boolean? = null, | ||
| case: TokenCase? = null, | ||
| includeSpecialCharacters: Boolean? = null, | ||
| split: Boolean? = null, | ||
| trim: Boolean? = null, | ||
| ) = ContainsTokenOptions(hasNames, case, includeSpecialCharacters, split, trim) |
24 changes: 24 additions & 0 deletions
24
.../ch/ergon/dope/resolvable/expression/type/function/token/ContainsTokenRegexpExpression.kt
This file contains hidden or 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,24 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.expression.operator.FunctionOperator | ||
| import ch.ergon.dope.resolvable.expression.type.TypeExpression | ||
| import ch.ergon.dope.resolvable.expression.type.toDopeType | ||
| import ch.ergon.dope.validtype.BooleanType | ||
| import ch.ergon.dope.validtype.StringType | ||
| import ch.ergon.dope.validtype.ValidType | ||
|
|
||
| data class ContainsTokenRegexpExpression( | ||
| val inputObject: TypeExpression<out ValidType>, | ||
| val regexExpression: TypeExpression<StringType>, | ||
| val tokenOptions: ContainsTokenOptions? = null, | ||
| ) : FunctionOperator<BooleanType> | ||
|
|
||
| fun TypeExpression<out ValidType>.containsTokenRegexp( | ||
| regexExpression: TypeExpression<StringType>, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = ContainsTokenRegexpExpression(this, regexExpression, tokenOptions) | ||
|
|
||
| fun TypeExpression<out ValidType>.containsTokenRegexp( | ||
|
jansigi marked this conversation as resolved.
|
||
| regexExpression: String, | ||
| tokenOptions: ContainsTokenOptions? = null, | ||
| ) = containsTokenRegexp(regexExpression.toDopeType(), tokenOptions) | ||
17 changes: 17 additions & 0 deletions
17
core/src/main/kotlin/ch/ergon/dope/resolvable/expression/type/function/token/TokenOptions.kt
This file contains hidden or 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,17 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.Resolvable | ||
|
|
||
| enum class TokenCase { LOWER, UPPER } | ||
|
|
||
| data class TokensOptions( | ||
| val hasName: Boolean? = null, | ||
| val case: TokenCase? = null, | ||
| val includeSpecialCharacters: Boolean? = null, | ||
| ) : Resolvable | ||
|
|
||
| fun tokenOptions( | ||
| hasName: Boolean? = null, | ||
| case: TokenCase? = null, | ||
| includeSpecialCharacters: Boolean? = null, | ||
| ) = TokensOptions(hasName, case, includeSpecialCharacters) |
28 changes: 28 additions & 0 deletions
28
...c/main/kotlin/ch/ergon/dope/resolvable/expression/type/function/token/TokensExpression.kt
This file contains hidden or 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,28 @@ | ||
| package ch.ergon.dope.resolvable.expression.type.function.token | ||
|
|
||
| import ch.ergon.dope.resolvable.expression.operator.FunctionOperator | ||
| import ch.ergon.dope.resolvable.expression.type.TypeExpression | ||
| import ch.ergon.dope.resolvable.expression.type.toDopeType | ||
| import ch.ergon.dope.validtype.ArrayType | ||
| import ch.ergon.dope.validtype.StringType | ||
|
|
||
| data class TokensExpression( | ||
| val inString: TypeExpression<ArrayType<StringType>>, | ||
| val tokensOptions: TokensOptions? = null, | ||
| ) : FunctionOperator<ArrayType<StringType>> | ||
|
|
||
| fun TypeExpression<ArrayType<StringType>>.tokenize(tokensOptions: TokensOptions) = TokensExpression(this, tokensOptions) | ||
|
|
||
| fun TypeExpression<ArrayType<StringType>>.tokenize( | ||
| hasName: Boolean? = null, | ||
| case: TokenCase? = null, | ||
| includeSpecialCharacters: Boolean? = null, | ||
| ) = TokensExpression(this, tokenOptions(hasName, case, includeSpecialCharacters)) | ||
|
|
||
| fun List<String>.tokenize(tokensOptions: TokensOptions) = toDopeType().tokenize(tokensOptions) | ||
|
|
||
| fun List<String>.tokenize( | ||
| hasName: Boolean? = null, | ||
| case: TokenCase? = null, | ||
| includeSpecialCharacters: Boolean? = null, | ||
| ) = toDopeType().tokenize(tokenOptions(hasName, case, includeSpecialCharacters)) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.