Class RegexFlags
java.lang.Object
org.springframework.data.mongodb.util.RegexFlags
Utility to translate
regex flags
to MongoDB regex options and vice versa.- Since:
- 3.3
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
toRegexFlag
(char c) Lookup the MongoDB specific flags for a given character.static int
Lookup the MongoDB specific flags for a given regex option string.static String
toRegexOptions
(int flags) Lookup the MongoDB specific options from givenflags
.
-
Method Details
-
toRegexOptions
Lookup the MongoDB specific options from givenflags
.- Parameters:
flags
- the Regex flags to look up.- Returns:
- the options string. May be empty.
-
toRegexFlags
Lookup the MongoDB specific flags for a given regex option string.- Parameters:
s
- the Regex option/flag to look up. Can be null.- Returns:
- zero if given
String
is null or empty. - Since:
- 2.2
-
toRegexFlag
public static int toRegexFlag(char c) Lookup the MongoDB specific flags for a given character.- Parameters:
c
- the Regex option/flag to look up.- Returns:
- Throws:
IllegalArgumentException
- for unknown flags- Since:
- 2.2
-