當前位置: 首頁>>代碼示例>>Java>>正文


Java ParseObject.getString方法代碼示例

本文整理匯總了Java中com.parse.ParseObject.getString方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseObject.getString方法的具體用法?Java ParseObject.getString怎麽用?Java ParseObject.getString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.parse.ParseObject的用法示例。


在下文中一共展示了ParseObject.getString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: conversationFromSubscription

import com.parse.ParseObject; //導入方法依賴的package包/類
public static ExampleConversation conversationFromSubscription(ParseObject subscription, ParseHelper helper) {
    final ParseObject chatParseObject = subscription.getParseObject(ChatSubscriptionTable.Fields.CHAT);
    if (chatParseObject.isDataAvailable()) {
        final String name = TextUtils.isEmpty(chatParseObject.getString(ChatTable.Fields.NAME)) ? subscription.getString(ChatSubscriptionTable.Fields.NAME) : chatParseObject.getString(ChatTable.Fields.NAME);
        final List<BaseUser> users = Collections.emptyList(); // TODO: Populate!
        int unread = chatParseObject.getInt(ChatTable.Fields.MESSAGE_COUNT) - subscription.getInt(ChatSubscriptionTable.Fields.LAST_SEEN_COUNT);
        final boolean hasLastMessage = chatParseObject.has(ChatTable.Fields.LAST_MESSAGE) && chatParseObject.getParseObject(ChatTable.Fields.LAST_MESSAGE).isDataAvailable();
        final ExampleMessage lastMessage = hasLastMessage ? from(chatParseObject.getParseObject(ChatTable.Fields.LAST_MESSAGE), helper) : null;
        return new ExampleConversation(chatParseObject.getObjectId(),
            name,
            users,
            lastMessage,
            unread);
    }
    else {
        return new ExampleConversation(chatParseObject.getObjectId());
    }
}
 
開發者ID:badoo,項目名稱:Chateau,代碼行數:19,代碼來源:ParseUtils.java

示例2: getEventFromParseObject

import com.parse.ParseObject; //導入方法依賴的package包/類
public static Event getEventFromParseObject(@NonNull ParseObject parseObject){
    ParseGeoPoint location = parseObject.getParseGeoPoint(Event.LOCATION);
    ParseFile parseFile = parseObject.getParseFile(Event.IMAGE);
    return new Event(parseObject.getObjectId(),
            parseObject.getString(Event.TITLE),
            parseObject.getString(Event.DESCRIPTION),
            location != null? location.getLatitude() : Event.INVALID_LOCATION,
            location != null? location.getLongitude() : Event.INVALID_LOCATION,
            parseObject.getString(Event.LOCATION_SUMMARY),
            parseObject.getString(Event.LOCATION_DESCRIPTION),
            parseFile != null? parseFile.getUrl() : null,
            parseObject.getDate(Event.INITIAL_DATE),
            // If end date is null, set it as initial date, so we can use it in our order by
            parseObject.getDate(Event.END_DATE) != null? parseObject.getDate(Event.END_DATE) : parseObject.getDate(Event.INITIAL_DATE),
            parseObject.getInt(Event.TYPE),
            parseObject.getBoolean(Event.ENABLED),
            (parseObject.getNumber(Event.GOING) != null)? parseObject.getNumber(Event.GOING).longValue() : 0,
            parseObject.getString(Event.LINK_URL),
            parseObject.getString(Event.LINK_TEXT),
            parseObject.getUpdatedAt()
    );
}
 
開發者ID:LibertACAO,項目名稱:libertacao-android,代碼行數:23,代碼來源:ParserDtoManager.java

示例3: performFiltering

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
protected FilterResults performFiltering(CharSequence constraint) {

    FilterResults results = new FilterResults();
    List<ParseObject> mainList = mAdapter.getMainList();
    if (constraint == null || constraint.length() == 0) {
        results.values = mainList;
        results.count = mainList.size();
    } else {
        ArrayList<ParseObject> filteredObjects = new ArrayList();
        String pattern = ((String) constraint).toLowerCase();
        for (ParseObject parseObject : mainList) {
            String item = parseObject.getString(ParseTables.College.NAME);
            if (item.toLowerCase().contains(pattern)) {
                filteredObjects.add(parseObject);
            }
        }
        results.values = filteredObjects;
        results.count = filteredObjects.size();
    }
    return results;
}
 
開發者ID:teamOSC,項目名稱:Studddinv2_android,代碼行數:23,代碼來源:CollegeSelectorFragment.java

示例4: performFiltering

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
protected FilterResults performFiltering(CharSequence constraint) {

    FilterResults results = new FilterResults();
    List<ParseObject> mainList = mAdapter.getMainList();
    if (constraint == null || constraint.length() == 0) {
        results.values = mainList;
        results.count = mainList.size();
    } else {
        ArrayList<ParseObject> filteredObjects = new ArrayList();
        String pattern = ((String) constraint).toLowerCase();
        for (ParseObject parseObject : mainList) {
            String item = parseObject.getString(ParseTables.Interests.NAME);
            if (item.toLowerCase().contains(pattern)) {
                filteredObjects.add(parseObject);
            }
        }
        results.values = filteredObjects;
        results.count = filteredObjects.size();
    }
    return results;
}
 
開發者ID:teamOSC,項目名稱:Studddinv2_android,代碼行數:23,代碼來源:ItemSelectorFragment.java

示例5: convertParseObjectToMinisters

import com.parse.ParseObject; //導入方法依賴的package包/類
private ArrayList<Minister> convertParseObjectToMinisters(List<ParseObject> list)
{
    ArrayList<Minister> ministers = new ArrayList<Minister>();
    Minister m;
    String name = "";
    String email = "";
    String position = "";
    boolean federal = false;
    for(ParseObject member: list)
    {
        name = member.getString("Name");
        position = member.getString("Minister_Position");
        email = member.getString("Email");

        m = new Minister(name, position, email);
        ministers.add(m);
    }

    return ministers;
}
 
開發者ID:DemocracyLink,項目名稱:DemocracyLink-Android,代碼行數:21,代碼來源:CreateEmailActivity.java

示例6: conversationFromChat

import com.parse.ParseObject; //導入方法依賴的package包/類
public static ExampleConversation conversationFromChat(ParseObject chat, ParseHelper helper) {
    String name = chat.getString(ChatTable.Fields.NAME);
    List<BaseUser> users = Collections.emptyList(); // TODO: Populate!
    int unread = 0;
    return new ExampleConversation(chat.getObjectId(),
        name,
        users,
        from((ParseObject) chat.get(ChatTable.Fields.LAST_MESSAGE), helper),
        unread);
}
 
開發者ID:badoo,項目名稱:Chateau,代碼行數:11,代碼來源:ParseUtils.java

示例7: getView

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
public View getView(final int position, View convertView, ViewGroup parent){
    ViewHolder holder ;
    if(convertView == null){
        convertView = LayoutInflater.from(mContext).inflate(R.layout.fragment_home,null);
        holder = new ViewHolder();

        holder.eventNameHP= (TextView) convertView.findViewById(R.id.eventName);
        holder.eventConHP = (TextView) convertView.findViewById(R.id.eventContext);
        holder.imageHP = (ImageView) convertView.findViewById(R.id.eventImage);

        convertView.setTag(holder);


    }
    else{
        holder= (ViewHolder) convertView.getTag();
    }
    ParseObject eventObject = mEvents.get(position);

    String eventName =  eventObject.getString("eventName");
    holder.eventNameHP.setText(eventName);

    String eventCon = eventObject.getString("eventContext");
    holder.eventConHP.setText(eventCon);

    Picasso.with(getContext().
            getApplicationContext()).
            load(eventObject.getParseFile("eventPhoto").
                    getUrl()).noFade().transform(new TransformationCircular()).
            into(holder.imageHP);


    eventid=eventObject.getObjectId();

    return convertView;
}
 
開發者ID:gokcan,項目名稱:Volo,代碼行數:38,代碼來源:EventAdapter.java

示例8: doBatchCrudRun

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
protected void doBatchCrudRun(int count) throws Exception {
    List<ParseObject> list = new ArrayList<>(count);
    for (int i = 0; i < count; i++) {
        list.add(createEntity(i));
    }

    startClock();
    ParseObject.pinAll(list);
    stopClock(Benchmark.Type.BATCH_CREATE);

    startClock();
    ParseObject.pinAll(list);
    stopClock(Benchmark.Type.BATCH_UPDATE);

    startClock();
    List<ParseObject> reloaded = ParseQuery.getQuery("SimpleEntity")
            .fromLocalDatastore()
            .find();
    stopClock(Benchmark.Type.BATCH_READ);

    startClock();
    for (int i = 0; i < reloaded.size(); i++) {
        ParseObject entity = reloaded.get(i);
        entity.getBoolean("simpleBoolean");
        entity.getInt("simpleByte");
        entity.getInt("simpleShort");
        entity.getInt("simpleInt");
        entity.getLong("simpleLong");
        entity.getDouble("simpleFloat");
        entity.getDouble("simpleDouble");
        entity.getString("simpleString");
        entity.getBytes("simpleByteArray");
    }
    stopClock(Benchmark.Type.BATCH_ACCESS);

    startClock();
    deleteAll();
    stopClock(Benchmark.Type.BATCH_DELETE);
}
 
開發者ID:greenrobot,項目名稱:android-database-performance,代碼行數:41,代碼來源:PerfTestParse.java

示例9: convertParseObjectToMembers

import com.parse.ParseObject; //導入方法依賴的package包/類
/**
 * This is basically copied from Setup4. I didn't move it to Utils because there are lots of
 * private variables in the Setup4 method and refactoring that sounded like a lot of work...
 * @param list
 */
private ArrayList<Member> convertParseObjectToMembers(List<ParseObject> list)
{
    ArrayList<Member> members = new ArrayList<Member>();
    Member m;
    String name = "";
    String constituency = "";
    String email = "";
    String phone = "";
    String province = "";
    boolean federal = false;
    for(ParseObject member: list)
    {
        name = member.getString("Name");
        constituency = member.getString("Constituency");
        phone = member.getString("Phone");
        email = member.getString("Email");
        province = member.getString("Province");
        federal = member.getString("Province") != null;
        if(!federal || (federal && Utils.convertProvinceToShortProvince(province).equals(Utils.convertProvinceToShortProvince(mProvince))))
        {
            m = new Member(name, constituency, email, phone, province, federal);
            members.add(m);
        }
    }
    
    return members;
}
 
開發者ID:DemocracyLink,項目名稱:DemocracyLink-Android,代碼行數:33,代碼來源:MainActivity.java

示例10: onListItemClick

import com.parse.ParseObject; //導入方法依賴的package包/類
public void onListItemClick(ListView l,View v, int position, long id){
    super.onListItemClick(l, v, position, id);


    ParseObject eventObject = mEvents.get(position);

    String objectId = eventObject.getObjectId();
    String eventName = eventObject.getString("eventName");
    String eventCon = eventObject.getString("eventContext");

    ClikedEventFragment fragment = new ClikedEventFragment();
    Bundle bundle = new Bundle();
    bundle.putString("id", objectId);


    bundle.putString("Context", eventCon);
    fragment.setArguments(bundle);
    FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();


    transaction.replace(R.id.navcontent, fragment, "EVENT_FRAGMENT");
    transaction.addToBackStack(null);

    transaction.commit();
}
 
開發者ID:gokcan,項目名稱:Volo,代碼行數:26,代碼來源:HomeFragment.java

示例11: onListItemClick

import com.parse.ParseObject; //導入方法依賴的package包/類
public void onListItemClick(ListView l,View v, int position, long id){
    super.onListItemClick(l, v, position, id);


    ParseObject eventObject = mParticipatedEvents.get(position);

    String objectId = eventObject.getObjectId();
    String eventName = eventObject.getString("eventName");
    String eventCon = eventObject.getString("eventContext");

    ClikedEventFragment fragment = new ClikedEventFragment();
    Bundle bundle = new Bundle();
    bundle.putString("id", objectId);


    bundle.putString("Context", eventCon);
    fragment.setArguments(bundle);
    FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();


    transaction.replace(R.id.navcontent, fragment, "EVENT_FRAGMENT");
    transaction.addToBackStack(null);

    transaction.commit();
}
 
開發者ID:gokcan,項目名稱:Volo,代碼行數:26,代碼來源:ProfileListFragment.java

示例12: convertParseObjectToMembers

import com.parse.ParseObject; //導入方法依賴的package包/類
/**
     * Converts a list of given Parse objects (either provincial or federal members) into 
     * corresponding Member objects and saves them to the corresponding local variable.
     * Then clears the ProgressDialog if it is active.
     * @param objectName
     * @param fetchedObjects
     */
    public void convertParseObjectToMembers(String objectName, List<ParseObject> fetchedObjects)
    {
        ArrayList<Member> members = new ArrayList<Member>();
        Member m;
        String name = "";
        String constituency = "";
        String email = "";
        String phone = "";
        String province = "";
        boolean federal = false;
        for(ParseObject member: fetchedObjects)
        {
            name = member.getString("Name");
            constituency = member.getString("Constituency");
            phone = member.getString("Phone");
            email = member.getString("Email");
            province = member.getString("Province");
            federal = member.getString("Province") != null;
            
            if(!federal || (federal && Utils.convertProvinceToShortProvince(province).equals(Utils.convertProvinceToShortProvince(mProvince))))
            {
                m = new Member(name, constituency, email, phone, province, federal);
                members.add(m);
            }
        }
        if(objectName.equals("Federal_Members")) {
            Setup4.this.federal_members = members;
            //if waiting dialog is showing the user has tried to find a member so start that activity
//            if(federalWaitingDialog.isShowing())
//            {
//                federalWaitingDialog.dismiss();
//                chooseFederalMember(null);
//            }
        }
        else {
            Setup4.this.provincial_members = members;
            //if waiting dialog is showing the user has tried to find a member so start that activity
//            if(provincialWaitingDialog.isShowing())
//            {
//                provincialWaitingDialog.dismiss();
//                chooseProvincialMember(null);
//            }
        }
        
        Log.i("Parse", "Found " + fetchedObjects.size() + " objects with type " + objectName);
    }
 
開發者ID:DemocracyLink,項目名稱:DemocracyLink-Android,代碼行數:54,代碼來源:Setup4.java

示例13: doInBackground

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
protected String doInBackground(String... params)
{
    userQuery = params[0];
    booksResults.clear();
/*
* Get the parse objects based on the query entered.
*/

    ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Posted");


    query.whereContains("useremail", userQuery);

    try
    {
        Log.w("Parse", "Inside getbooks()");
        List<ParseObject> queryResult = query.find();
        for (ParseObject book : queryResult)
        {

            HashMap<String, String> test = new HashMap<>();

            String dept = book.getString("dept");
            String title = book.getString("Title");
            String author = book.getString("Author");
            String price = book.getString("Price");
            String place = book.getString("Place");
            String desp = book.getString("Description");
            String phone = book.getString("phone");
            String oprice = book.getString("oprice");
            String objId = book.getObjectId();
            String status = book.getString("status");


            test.put("dept", dept);
            test.put("title", title);
            test.put("author", author);
            test.put("price", price);
            test.put("place", place);
            test.put("description", desp);
            test.put("phone", phone);
            test.put("oprice", oprice);
            test.put("objectId",objId);
            test.put("status",status);

            booksResults.add(test);
        }
    }
    catch (ParseException e)
    {

        Log.d("Books", "Error: " + e.getMessage());

    }

    return userQuery;
}
 
開發者ID:karnikram,項目名稱:seglio,代碼行數:59,代碼來源:AccountFragment.java

示例14: doInBackground

import com.parse.ParseObject; //導入方法依賴的package包/類
@Override
protected String doInBackground(String... params)
{
    userQuery = params[0];
    booksResults.clear();
/*
* Get the parse objects based on the query entered.
*/

    ParseQuery<ParseObject> query = new ParseQuery<ParseObject>("Posted");

    if (flag == 0)
    {
        String lowTitle = userQuery.toLowerCase();
        query.whereContains("title", lowTitle);
    }
    else
        if (flag == 1)
        {
            String lowAuthor = userQuery.toLowerCase();
            query.whereContains("author", lowAuthor);
        }
        else

            query.whereContains("dept", userQuery);


    try
    {
        Log.w("Parse", "Inside getbooks()");
        List<ParseObject> queryResult = query.find();
        for (ParseObject book : queryResult)
        {

            HashMap<String, String> test = new HashMap<>();

            String dept = book.getString("dept");
            String title = book.getString("Title");
            String author = book.getString("Author");
            String price = book.getString("Price");
            String place = book.getString("Place");
            String desp = book.getString("Description");
            String phone = book.getString("phone");
            String oprice = book.getString("oprice");
            String userName = book.getString("username");
            String userEmail = book.getString("useremail");
            String status = book.getString("status");


            test.put("dept", dept);
            test.put("title", title);
            test.put("author", author);
            test.put("price", price);
            test.put("place", place);
            test.put("description", desp);
            test.put("phone", phone);
            test.put("oprice", oprice);
            test.put("username",userName);
            test.put("useremail",userEmail);
            test.put("status",status);

            booksResults.add(test);
        }

    }
    catch (ParseException e)
    {
        Log.d("Books", "Error: " + e.getMessage());
    }

    return userQuery;
}
 
開發者ID:karnikram,項目名稱:seglio,代碼行數:73,代碼來源:SearchFragment.java

示例15: get

import com.parse.ParseObject; //導入方法依賴的package包/類
public static String get(ParseObject parseObject, String key, String defValue) {
    return parseObject.getString(key);
}
 
開發者ID:yongjhih,項目名稱:auto-parse,代碼行數:4,代碼來源:AutoParseHelper.java


注:本文中的com.parse.ParseObject.getString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。