本文整理汇总了Java中org.febit.util.StringUtil.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.isEmpty方法的具体用法?Java StringUtil.isEmpty怎么用?Java StringUtil.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.febit.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: find
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public <T extends Entity> LcFindResponse<T> find(String id, String table, Class<T> entityType, String[] keys) {
if (StringUtil.isEmpty(id)) {
throw new IllegalArgumentException("id is required");
}
if (table == null) {
table = getEntityTableName(entityType);
}
EasyRequest request = new EasyRequest()
.get()
.addPathSegment(apiVersion)
.addPathSegment("classes")
.addPathSegment(table)
.addPathSegment(id);
if (keys != null && keys.length != 0) {
request.query("keys", StringUtil.join(keys, ','));
}
return readFindResponse(sendRequest(request), entityType);
}
示例2: delete
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public <T extends Entity> LcDeleteResponse delete(String id, String table, Class<T> entityType, Condition where) {
if (StringUtil.isEmpty(id)) {
throw new IllegalArgumentException("id is required");
}
if (table == null) {
table = getEntityTableName(entityType);
}
EasyRequest request = new EasyRequest()
.delete()
.addPathSegment(apiVersion)
.addPathSegment("classes")
.addPathSegment(table);
if (id != null) {
request.addPathSegment(id);
}
if (where != null) {
request.query("where", JsonUtil.toJsonString(where));
}
return readBasicResponse(sendRequest(request));
}
示例3: update
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public <T extends Entity> LcUpdateResponse update(String id, String table, Class<T> entityType, Map<String, ?> changes) {
if (StringUtil.isEmpty(id)) {
throw new IllegalArgumentException("id is required");
}
if (table == null) {
table = getEntityTableName(entityType);
}
EasyRequest request = new EasyRequest()
.put()
.addPathSegment(apiVersion)
.addPathSegment("classes")
.addPathSegment(table)
.addPathSegment(id);
setJsonBody(request, changes);
return readBasicResponse(sendRequest(request));
}
示例4: createDao
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public <E extends Entity> ArangoDao<E> createDao(Class<E> entityType, String tableName) {
if (StringUtil.isEmpty(tableName)) {
tableName = resolveTableName(entityType);
}
ArangoCollection collection = collection(tableName);
return new ArangoDao<>(entityType, collection, resolveIdCenerator(entityType));
}
示例5: resolveTableName
import org.febit.util.StringUtil; //导入方法依赖的package包/类
protected String resolveTableName(Class<?> entityType) {
String tableName = null;
Arango anno = entityType.getAnnotation(Arango.class);
if (anno != null) {
tableName = anno.value();
}
if (StringUtil.isEmpty(tableName)) {
tableName = entityType.getSimpleName();
LOG.warn("ArangoDao for '{}' used class name '{}' as collection name.", entityType.getName(), tableName);
}
return tableName;
}
示例6: getStringId
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public String getStringId() {
if (StringUtil.isEmpty(id)) {
return null;
}
return id;
}
示例7: toBool
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static boolean toBool(final String value, boolean defaultValue) {
if (StringUtil.isEmpty(value)) {
return defaultValue;
}
return FieldUtil.isCheckedOn(value);
}
示例8: toShort
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static Short toShort(final String value) {
if (StringUtil.isEmpty(value)) {
return null;
}
return Short.parseShort(value);
}
示例9: toInteger
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static Integer toInteger(final String value, Integer defaultValue) {
if (StringUtil.isEmpty(value)) {
return defaultValue;
}
return Integer.parseInt(value);
}
示例10: toInt
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static int toInt(final String value, int defaultValue) {
if (StringUtil.isEmpty(value)) {
return defaultValue;
}
return Integer.parseInt(value);
}
示例11: toLong
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static Long toLong(final String value) {
if (StringUtil.isEmpty(value)) {
return null;
}
return Long.parseLong(value);
}
示例12: toDouble
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public static Double toDouble(final String value, Double defaultValue) {
if (StringUtil.isEmpty(value)) {
return defaultValue;
}
return Double.parseDouble(value);
}
示例13: getIntIds
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public int[] getIntIds() {
if (StringUtil.isEmpty(ids)) {
return null;
}
return Convert.toIntArray(ids);
}
示例14: getLongIds
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public long[] getLongIds() {
if (StringUtil.isEmpty(ids)) {
return null;
}
return Convert.toLongArray(ids);
}
示例15: getStringIds
import org.febit.util.StringUtil; //导入方法依赖的package包/类
public String[] getStringIds() {
if (StringUtil.isEmpty(ids)) {
return null;
}
return Convert.toStringArray(ids);
}