本文整理汇总了Java中com.facebook.react.bridge.ReadableType.Boolean方法的典型用法代码示例。如果您正苦于以下问题:Java ReadableType.Boolean方法的具体用法?Java ReadableType.Boolean怎么用?Java ReadableType.Boolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.react.bridge.ReadableType
的用法示例。
在下文中一共展示了ReadableType.Boolean方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCreateQuery
import com.facebook.react.bridge.ReadableType; //导入方法依赖的package包/类
private StringBuilder buildCreateQuery(String tableName, ReadableMap props, List<String> keys) {
final StringBuilder queryBuilder = new StringBuilder("CREATE TABLE IF NOT EXISTS ").append(tableName).append(" ");
queryBuilder.append("(");
queryBuilder.append("id INTEGER PRIMARY KEY AUTOINCREMENT");
for (String key : keys) {
String propType = null;
if(props.getType(key) == ReadableType.Boolean) {
propType = "BOOLEAN";
} else if(props.getType(key) == ReadableType.String) {
propType = "TEXT";
} else if(props.getType(key) == ReadableType.Number) {
propType = "DOUBLE";
}
if(propType != null) {
queryBuilder.append(", ").append(key).append(" ").append(propType);
}
}
queryBuilder.append(")");
return queryBuilder;
}
示例2: buildQueryArgument
import com.facebook.react.bridge.ReadableType; //导入方法依赖的package包/类
private ArrayList<String> buildQueryArgument(List<String> keys, ReadableMap query) {
final ArrayList<String> arguments = new ArrayList<>();
for (String key : keys) {
ReadableType type = query.getType(key);
if(type == ReadableType.Boolean) {
arguments.add(String.valueOf(query.getBoolean(key)));
} else if(type == ReadableType.Number) {
arguments.add(String.valueOf(query.getDouble(key)));
} else if(type == ReadableType.String) {
arguments.add(String.valueOf(query.getString(key)));
}
}
return arguments;
}
示例3: getUserProperties
import com.facebook.react.bridge.ReadableType; //导入方法依赖的package包/类
private Map<String, Object> getUserProperties(ReadableMap properties) {
ReadableMapKeySetIterator iterator = properties.keySetIterator();
Map<String, Object> userProperties = new HashMap<>();
while (iterator.hasNextKey()) {
String key = iterator.nextKey();
ReadableType type = properties.getType(key);
if (type == ReadableType.Boolean) {
userProperties.put(key, properties.getBoolean(key));
} else if (type == ReadableType.Number) {
userProperties.put(key, properties.getDouble(key));
} else if (type == ReadableType.String) {
userProperties.put(key, properties.getString(key));
}
}
return userProperties;
}
示例4: prepareInsertContentValues
import com.facebook.react.bridge.ReadableType; //导入方法依赖的package包/类
private ContentValues prepareInsertContentValues(ReadableMap props, List<String> keys) {
final ContentValues contentValues = new ContentValues();
for (String key : keys) {
if(props.getType(key) == ReadableType.Boolean) {
contentValues.put(key, props.getBoolean(key));
} else if(props.getType(key) == ReadableType.Number) {
contentValues.put(key, props.getDouble(key));
} else if(props.getType(key) == ReadableType.String) {
contentValues.put(key, props.getString(key));
}
}
return contentValues;
}
示例5: prepareUpdateContentValues
import com.facebook.react.bridge.ReadableType; //导入方法依赖的package包/类
private ContentValues prepareUpdateContentValues(ReadableMap props, List<String> keys) {
final ContentValues contentValues = new ContentValues();
for (String key : keys) {
if(props.getType(key) == ReadableType.Boolean) {
contentValues.put(key, props.getBoolean(key));
} else if(props.getType(key) == ReadableType.Number) {
contentValues.put(key, props.getDouble(key));
} else if(props.getType(key) == ReadableType.String) {
contentValues.put(key, props.getString(key));
}
}
return contentValues;
}