本文整理匯總了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;
}