本文整理汇总了Java中org.bson.BasicBSONObject.getString方法的典型用法代码示例。如果您正苦于以下问题:Java BasicBSONObject.getString方法的具体用法?Java BasicBSONObject.getString怎么用?Java BasicBSONObject.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bson.BasicBSONObject
的用法示例。
在下文中一共展示了BasicBSONObject.getString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfigServersFromMongos
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
private List<String> getConfigServersFromMongos(
final String host,
final int port
) throws Exception {
final List<String> cfgServers = new ArrayList<String>();
final BasicBSONObject parsed = getParsedCmdLineOpts(host, port);
final BasicBSONObject sharding =
(BasicBSONObject) parsed.get("sharding");
String cfgServerString;
if (sharding != null)
cfgServerString = sharding.getString("configDB");
else
cfgServerString = (String) parsed.get("configDB");
addCommaSeparatedHosts(cfgServers, cfgServerString);
return cfgServers;
}
示例2: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse) {
//si on vient de cr�er une transaction
if(bsonResponse.getString(RESQUEST_TAG) == POST_TRANSACTION_TAG){
//on met � jour le solde de l'utilisateur dans la session en cours
User.setAccountBalance(Integer.parseInt(bsonResponse.getString(ServerHelper.SERVER_BALANCE_KEY)));
}
//si on vient de "fetch" le wallet
if(bsonResponse.getString(RESQUEST_TAG) == GET_WALLET_TAG){
//on met � jour le solde de l'utilisateur dans la session en cours
User.setAccountBalance(Integer.parseInt(bsonResponse.getString(ServerHelper.SERVER_BALANCE_KEY)));
}
//si on vient de "fetch" les transactions
if(bsonResponse.getString(RESQUEST_TAG) == GET_TRANSACTION_TAG){
//...
//la il faudrait mettre les transactions en cache (dans TransactionList.java par exemple)
}
return null;
}
示例3: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse) {
if(bsonResponse.getString(ServerHelper.RESQUEST_TAG) == ServerHelper.GET_TRANSACTION_TAG){
//Log.i("ADAPTER", "getting result : "+bsonResponse.get(ServerHelper.SERVER_TRANSACTIONS_KEY).toString());
BasicBSONList bsonList = (BasicBSONList) bsonResponse.get(ServerHelper.SERVER_TRANSACTIONS_KEY);
this.items.clear();
for(int i = 0; i < bsonList.size(); i++){
BasicBSONObject bsonData = (BasicBSONObject) bsonList.get(i);
if(!bsonData.getString(ServerHelper.SERVER_SENDER_KEY).equals(ServerHelper.SYSTEM_USER_TAG)){
int transactionAmount = Integer.parseInt(bsonData.getString(ServerHelper.SERVER_TRANSACTION_AMOUNT_KEY));
Transaction tmpTransaction = new Transaction(
bsonData.getString(ServerHelper.SERVER_ID_KEY),
bsonData.getString(ServerHelper.SERVER_RECEIVER_KEY),
bsonData.getString(ServerHelper.SERVER_SENDER_KEY),
transactionAmount);
this.add(tmpTransaction);
}
}
}
//Log.i("TransactionListAdapter", this.items.toString());
this.notifyDataSetChanged();
return null;
}
示例4: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse) {
if(bsonResponse.getString(ServerHelper.RESQUEST_TAG) == ServerHelper.SIGN_UP_TAG){
this.signUpBtn.hideLoader();
NavUtils.navigateUpFromSameTask(this);
}
return null;
}
示例5: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse) {
if(bsonResponse.getString(ServerHelper.RESQUEST_TAG) == ServerHelper.GET_WALLET_TAG){
this.userAccountBalance.setText(bsonResponse.getString(ServerHelper.SERVER_BALANCE_KEY));
}else{
//Log.e("ERROR", "no balance in : " + bsonResponse.toString());
}
return null;
}
示例6: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse){
if(bsonResponse.getString(ServerHelper.RESQUEST_TAG) == ServerHelper.LOGOUT_TAG){
Intent loadLogin = new Intent(getApplicationContext(), LoginActivity.class);
loadLogin.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
this.startActivity(loadLogin);
this.finish();
}
return null;
}
示例7: call
import org.bson.BasicBSONObject; //导入方法依赖的package包/类
@Override
public Object call(BasicBSONObject bsonResponse){
super.call(bsonResponse);
//si la requ�te envoy�e correspond � la cr�ation d'une nouvelle transaction (un post de transaction)
if(bsonResponse.getString(ServerHelper.RESQUEST_TAG) == ServerHelper.POST_TRANSACTION_TAG){
//on retourne sur la page "wallet"
Intent walletActivity = new Intent(getApplicationContext(), WalletActivity.class);
walletActivity.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
this.startActivity(walletActivity);
this.finish();
}
this.formPaymentFragment.hideLoader();
return null;
}