public enum StringMatchType extends java.lang.Enum<StringMatchType> implements com.google.common.base.Function<java.lang.String,java.lang.String>
| Enum Constant and Description |
|---|
CMP_LEFT_MATCH
字符串比较匹配,
比较字符串是否以pattern起始,如 'hello' 匹配 'hello,world'
|
CMP_MATCH
字符串比较匹配,
比较字符串是否包含pattern,如 'wo' 匹配 'hello,world'
|
CMP_RIGHT_MATCH
字符串比较匹配,
比较字符串是否以pattern结尾,如 'world' 匹配 'hello,world'
|
DIGIT_FUZZY_LEFT_MATCH
左侧数字模糊匹配
pattern必须全部为数字,
比较字符串中所有数字组成的字符串是否以pattern数字序列起始,如'102'匹配'10幛/22房间',但不匹配'/1楼/102房间'
|
DIGIT_FUZZY_MATCH
数字模糊匹配
pattern必须全部为数字,
比较字符串中所有数字组成的字符串是否包含pattern数字序列,如'102'匹配'102-2房间','122'匹配'/1楼/2单元/2房间'
|
DIGIT_FUZZY_RIGHT_MATCH
右侧数字模糊匹配
pattern必须全部为数字,
比较字符串中所有数字组成的字符串是否以pattern数字序列结尾,如'102'匹配'/1楼/102房间',但不匹配'102-2房间'
|
DIGIT_SEP_FUZZY_LEFT_MATCH
带分隔符'/'的左侧数字模糊匹配
pattern必须为数字及分隔符'/','-','.',分隔符会被替换为'/',
比较字符串中所有数字组成的字符串是否以pattern数字起始,如'1-102'匹配'1楼/102-2房间',不匹配'1幢/1单元/102房间'
|
DIGIT_SEP_FUZZY_MATCH
带分隔符'/'的数字模糊匹配
pattern必须为数字及分隔符'/','-','.',分隔符会被替换为'/',
比较字符串中所有数字组成的字符串是否包含pattern数字序列,如'1-102'匹配'1楼/102房间',不匹配'1楼/1102房间'
|
DIGIT_SEP_FUZZY_RIGHT_MATCH
带分隔符'/'的右侧数字模糊匹配
pattern必须为数字及分隔符'/','-','.',分隔符会被替换为'/',
比较字符串中所有数字组成的字符串是否以pattern数字结尾,如'1/102'匹配'1楼/1单元/102房间',不匹配'1幢/102-2房间'
|
EXACTLY_MATCH
精确匹配,
比较字符串是否与pattern完全相等
|
FUZZY_MATCH
全字模糊匹配
pattern为要匹配的字符串序列
比较字符串是否混入pattern字符序列,如'12房'匹配'/1楼/102房间','王鹏'匹配'王小鹏','王鹏程','周王鹏','王鹏'
|
REGEX_MATCH
正则表达式匹配
pattern为正则表达式,表达式,如果pattern不以'^'或'|$'结尾,会自动加上'^.*'开头和'.*$'结尾
比较字符串是否有满足pattern的正则匹配,如'1\d+'匹配'/1楼/102房间'
|
WILDCARD_MATCH
支持通配符的字符串比较匹配
pattern中允许包含通配符('*','?'),'*'匹配任意0或多个字符,'?'匹配任意单个字符
比较字符串是否包含pattern,如 '1*2房' 匹配 '1032房间',匹配'10楼/32房间','1?2'匹配'1楼2单元','1?2房'不匹配'1032房间'
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
apply(java.lang.String input) |
IStringMatchFilter |
createMatchFilter() |
static StringMatchType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static StringMatchType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StringMatchType EXACTLY_MATCH
public static final StringMatchType CMP_LEFT_MATCH
public static final StringMatchType CMP_RIGHT_MATCH
public static final StringMatchType CMP_MATCH
public static final StringMatchType WILDCARD_MATCH
public static final StringMatchType DIGIT_FUZZY_MATCH
public static final StringMatchType DIGIT_FUZZY_LEFT_MATCH
public static final StringMatchType DIGIT_FUZZY_RIGHT_MATCH
public static final StringMatchType DIGIT_SEP_FUZZY_MATCH
public static final StringMatchType DIGIT_SEP_FUZZY_LEFT_MATCH
public static final StringMatchType DIGIT_SEP_FUZZY_RIGHT_MATCH
public static final StringMatchType REGEX_MATCH
public static final StringMatchType FUZZY_MATCH
public static StringMatchType[] values()
for (StringMatchType c : StringMatchType.values()) System.out.println(c);
public static StringMatchType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.String apply(java.lang.String input)
apply in interface com.google.common.base.Function<java.lang.String,java.lang.String>public IStringMatchFilter createMatchFilter()
Copyright © 2021. All Rights Reserved.