当前位置: 首页>>代码示例>>Java>>正文


Java BasicBSONObject.getString方法代码示例

本文整理汇总了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;
}
 
开发者ID:CA-APM,项目名称:ca-apm-fieldpack-mongodb,代码行数:20,代码来源:ShardCluster.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:20,代码来源:ServerHelper.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:24,代码来源:TransactionListAdapter.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:9,代码来源:SignupActivity.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:10,代码来源:UserSoldeFragment.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:11,代码来源:NavDrawerActivity.java

示例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;
}
 
开发者ID:steven89,项目名称:if26_projet,代码行数:15,代码来源:PaiementActivity.java


注:本文中的org.bson.BasicBSONObject.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。