本文整理汇总了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());
}
}
示例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()
);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例15: get
import com.parse.ParseObject; //导入方法依赖的package包/类
public static String get(ParseObject parseObject, String key, String defValue) {
return parseObject.getString(key);
}