public static Matcher<JsonElement> withCharsMoreOrEqualTo(final int value) {
return new TypeSafeDiagnosingMatcher<JsonElement>() {
@Override
protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
//we do not care for the properties if parent item is not String
if (!item.isString()) return true;
if (item.asString().length() < value) {
mismatchDescription.appendText("String length less than minimum value: " + value);
return false;
}
return true;
}
@Override
public void describeTo(Description description) {
description.appendText("String minimum length");
}
};
}
CommonMatchers.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:JustJson
作者:
评论列表
文章目录