Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
App Blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Genesys PGR
App Blocks
Commits
682742c1
Commit
682742c1
authored
May 08, 2020
by
Maxym Borodenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added helper methods to StringFilter
parent
72fb1734
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
2 deletions
+50
-2
core/src/main/java/org/genesys/blocks/model/filters/StringFilter.java
...n/java/org/genesys/blocks/model/filters/StringFilter.java
+50
-2
No files found.
core/src/main/java/org/genesys/blocks/model/filters/StringFilter.java
View file @
682742c1
...
...
@@ -16,6 +16,7 @@
package
org.genesys.blocks.model.filters
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.Set
;
...
...
@@ -67,17 +68,64 @@ public class StringFilter {
}
/**
* Eq.
* Eq
uals
.
*
* @param val the val
* @return the string filter
*
* @deprecated Use {@link #eq(String[])}
*/
public
static
StringFilter
eq
(
final
String
...
val
)
{
public
static
StringFilter
eq
uals
(
final
String
...
val
)
{
final
StringFilter
filter
=
new
StringFilter
();
filter
.
eq
=
Sets
.
newHashSet
(
val
);
return
filter
;
}
/**
* Eq.
*
* @param val the val
* @return the string filter
*/
public
StringFilter
eq
(
final
String
...
val
)
{
if
(
eq
!=
null
&&
!
eq
.
isEmpty
())
{
eq
.
addAll
(
Arrays
.
asList
(
val
));
}
else
{
eq
=
Sets
.
newHashSet
(
val
);
}
return
this
;
}
/**
* Contains.
*
* @param val the val
* @return the string filter
*/
public
StringFilter
contains
(
final
String
...
val
)
{
if
(
contains
!=
null
&&
!
contains
.
isEmpty
())
{
contains
.
addAll
(
Arrays
.
asList
(
val
));
}
else
{
contains
=
Sets
.
newHashSet
(
val
);
}
return
this
;
}
/**
* Sw.
*
* @param val the val
* @return the string filter
*/
public
StringFilter
sw
(
final
String
...
val
)
{
if
(
sw
!=
null
&&
!
sw
.
isEmpty
())
{
sw
.
addAll
(
Arrays
.
asList
(
val
));
}
else
{
sw
=
Sets
.
newHashSet
(
val
);
}
return
this
;
}
static
class
SetDeserializer
extends
JsonDeserializer
<
Set
<
String
>>
{
@Override
public
Set
<
String
>
deserialize
(
JsonParser
jsonParser
,
DeserializationContext
deserializationContext
)
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment