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


Java Exclude類代碼示例

本文整理匯總了Java中com.google.firebase.database.Exclude的典型用法代碼示例。如果您正苦於以下問題:Java Exclude類的具體用法?Java Exclude怎麽用?Java Exclude使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: shouldIncludeSetter

import com.google.firebase.database.Exclude; //導入依賴的package包/類
private static boolean shouldIncludeSetter(Method method) {
  if (!method.getName().startsWith("set")) {
    return false;
  }
  // Exclude methods from Object.class
  if (method.getDeclaringClass().equals(Object.class)) {
    return false;
  }
  // Static methods
  if (Modifier.isStatic(method.getModifiers())) {
    return false;
  }
  // Has a return type
  if (!method.getReturnType().equals(Void.TYPE)) {
    return false;
  }
  // Methods without exactly one parameters
  if (method.getParameterTypes().length != 1) {
    return false;
  }
  // Excluded methods
  if (method.isAnnotationPresent(Exclude.class)) {
    return false;
  }
  return true;
}
 
開發者ID:firebase,項目名稱:firebase-admin-java,代碼行數:27,代碼來源:CustomClassMapper.java

示例2: shouldIncludeField

import com.google.firebase.database.Exclude; //導入依賴的package包/類
private static boolean shouldIncludeField(Field field) {
  // Exclude methods from Object.class
  if (field.getDeclaringClass().equals(Object.class)) {
    return false;
  }
  // Non-public fields
  if (!Modifier.isPublic(field.getModifiers())) {
    return false;
  }
  // Static fields
  if (Modifier.isStatic(field.getModifiers())) {
    return false;
  }
  // Transient fields
  if (Modifier.isTransient(field.getModifiers())) {
    return false;
  }
  // Excluded fields
  if (field.isAnnotationPresent(Exclude.class)) {
    return false;
  }
  return true;
}
 
開發者ID:firebase,項目名稱:firebase-admin-java,代碼行數:24,代碼來源:CustomClassMapper.java

示例3: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();
    result.put("id", id);
    result.put("fullName",fullName);
    result.put("birthDate",birthDate);
    result.put("birthYear", birthYear);
    result.put("height",height);
    result.put("aboutMe",aboutMe);
    result.put("userLocation",userLocation);
    result.put("jobPosition",jobPosition);
    result.put("companyName",companyName);
    result.put("companyLocation",companyLocation);
    result.put("jobStartDate",jobStartDate);
    result.put("homeEmail",homeEmail);
    result.put("homePhone",homePhone);
    result.put("workEmail",workEmail);
    result.put("workPhone",workPhone);
    result.put("facebookName",facebookName);
    result.put("facebookLink",facebookLink);
    result.put("instaName",instaName);
    result.put("instaLink",instaLink);
    return result;
}
 
開發者ID:braulio94,項目名稱:Quadro,代碼行數:25,代碼來源:Details.java

示例4: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();
    result.put("uid", uid);
    result.put("author", author);
    result.put("title", title);
    result.put("body", body);
    result.put("image", image);
    result.put("starCount", starCount);
    result.put("stars", stars);
    result.put("authorImage", authorImage);
    result.put("authorName", authorName);
    result.put("authorJobTitle", authorJobTitle);
    result.put("aboutTheAuthor", aboutTheAuthor);
    result.put("timeStamp", ServerValue.TIMESTAMP);

    return result;
}
 
開發者ID:braulio94,項目名稱:Quadro,代碼行數:19,代碼來源:Post.java

示例5: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();
    result.put("id", id);
    result.put("uid", uid);
    result.put("author", author);
    result.put("title", title);
    result.put("body", body);
    result.put("price", price);
    result.put("date", date);
    result.put("picture", picture);
    result.put("status", status);
    result.put("category", category);
    result.put("starCount", starCount);
    result.put("stars", stars);

    return result;
}
 
開發者ID:sloiza,項目名稱:changApp,代碼行數:19,代碼來源:Changa.java

示例6: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
// on map l'univers
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();
    result.put("Id", id);
    result.put("Name", name);
    ListIterator iterator = universeUserList.listIterator();
    // on appel la fonction de mapping des contacts
    while(iterator.hasNext()){

        Contact contact= (Contact)iterator.next();
        HashMap<String,Object> contacthashed= contact.toMap();
        iterator.previous();
        iterator.set(contacthashed);
        iterator.next();
    }
    result.put("UniverseUserList", universeUserList);
    // celle de mapping des MOI
    if (MOIList!=null){
        MoiListtoMap();
   }
    else MOIList =  new ArrayList<MOI>();
    result.put("MOIList", MOIList);

    return result;
}
 
開發者ID:jkobject,項目名稱:PiPle,代碼行數:27,代碼來源:Universe.java

示例7: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();

    result.put("teamName", teamName);
    result.put("teamID", teamID);
    result.put("teamMembers", teamMembers);
    result.put("latitude", latitude);
    result.put("longitude", longitude);
    result.put("status", status);
    result.put("travelTime", travelTime);
    result.put("travelTime", travelTimeReadable);
    result.put("tokens", tokens);

    return result;
}
 
開發者ID:panzerama,項目名稱:Dispatch,代碼行數:17,代碼來源:Team.java

示例8: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();

    result.put("currentTeam", currentTeam);
    result.put("userID", userID);
    result.put("currentRole", currentRole);
    result.put("currentStatus", currentStatus);
    result.put("email", email);
    result.put("phone", phone);
    result.put("token", token);
    result.put("latitude", latitude);
    result.put("longitude", longitude);
    result.put("firstName", firstName);
    result.put("lastName", lastName);

    return result;
}
 
開發者ID:panzerama,項目名稱:Dispatch,代碼行數:19,代碼來源:User.java

示例9: getHabit

import com.google.firebase.database.Exclude; //導入依賴的package包/類
/**
 * Convert to a habit
 * @return the corresponding Habit object
 */
@Exclude
public Habit getHabit() {
    HashSet<Integer> newSchedule = new HashSet<>(DateTimeConstants.DAYS_PER_WEEK);
    for(int i = 0; i < schedule.size(); i++) {
        if(schedule.get(i)) {
            newSchedule.add(i + 1);
        }
    }

    Habit habit = new Habit();
    habit.setKey(key);
    habit.setUserId(userId);
    habit.setTitle(title);
    habit.setReason(reason);
    habit.setStartDate(new DateTime(startDate));
    habit.setSchedule(newSchedule);
    habit.setCompletionRate(completionRate);

    if (completionRate != null) {
        habit.setStatus(HabitStatus.fromCompletionRate(completionRate));
    }

    return habit;
}
 
開發者ID:CMPUT301F17T13,項目名稱:cat-is-a-dog,代碼行數:29,代碼來源:HabitDataModel.java

示例10: canBeMade

import com.google.firebase.database.Exclude; //導入依賴的package包/類
/**
 * Item cam be made if the user has all of the items
 * needed for the recipe, not considering the amount
 */
@Exclude
public boolean canBeMade(List<StockItem> stock){
    for (Map.Entry<String, Object> r : this.resources.entrySet())
    {
        for (StockItem s : stock) {
            if (r.getKey().equals(s.getName())){
                int amountMissing = Integer.parseInt(r.getValue().toString())-s.getAmount();

                if (amountMissing > 0){
                    missingItems.put(s.getName(),amountMissing);
                }

                if(canBeMadeWithAvaibleStock && s.getAmount() == 0){
                    canBeMadeWithAvaibleStock = false;
                }

                break;
            }
        }
    }

    return this.canBeMadeWithAvaibleStock;
}
 
開發者ID:WilderPereira,項目名稱:Reciclo,代碼行數:28,代碼來源:Recipe.java

示例11: getCardCount

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
private Single<Integer> getCardCount(final String type) {
    return Single.defer(new Callable<SingleSource<? extends Integer>>() {
        @Override
        public SingleSource<? extends Integer> call() throws Exception {
            return new Single<Integer>() {
                @Override
                protected void subscribeActual(SingleObserver<? super Integer> observer) {
                    int count = 0;
                    for (String cardId : cardCount.keySet()) {
                        if (getCards().get(cardId).getType().equals(type)) {
                            count += cardCount.get(cardId);
                        }
                    }
                    observer.onSuccess(count);
                }
            };
        }
    });
}
 
開發者ID:jamieadkins95,項目名稱:Roach,代碼行數:21,代碼來源:Deck.java

示例12: shouldIncludeGetter

import com.google.firebase.database.Exclude; //導入依賴的package包/類
private static boolean shouldIncludeGetter(Method method) {
  if (!method.getName().startsWith("get") && !method.getName().startsWith("is")) {
    return false;
  }
  // Exclude methods from Object.class
  if (method.getDeclaringClass().equals(Object.class)) {
    return false;
  }
  // Non-public methods
  if (!Modifier.isPublic(method.getModifiers())) {
    return false;
  }
  // Static methods
  if (Modifier.isStatic(method.getModifiers())) {
    return false;
  }
  // No return type
  if (method.getReturnType().equals(Void.TYPE)) {
    return false;
  }
  // Non-zero parameters
  if (method.getParameterTypes().length != 0) {
    return false;
  }
  // Excluded methods
  if (method.isAnnotationPresent(Exclude.class)) {
    return false;
  }
  return true;
}
 
開發者ID:firebase,項目名稱:firebase-admin-java,代碼行數:31,代碼來源:CustomClassMapper.java

示例13: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
/**
 * transform this Object into a map
 *
 * @return the user map
 */

@Exclude
public Map<String, Object> toMap() {
    HashMap<String, Object> result = new HashMap<>();
    result.put("Id", id);
    result.put("Pseudo", pseudo);
    result.put("ContactList", ContactList);
    result.put("ProfilPicture", profilpicture);


    return result;
}
 
開發者ID:jkobject,項目名稱:PiPle,代碼行數:18,代碼來源:User.java

示例14: getHabitEvent

import com.google.firebase.database.Exclude; //導入依賴的package包/類
/**
 * Convert to a habitKey event object
 * @return the habitKey event object
 */
@Exclude
public HabitEvent getHabitEvent() {
    HabitEvent event = new HabitEvent();
    event.setKey(key);
    event.setUserId(userId);
    event.setHabitKey(habitKey);
    event.setComment(comment);
    event.setPhotoUrl(photoUrl);
    event.setLatitude(latitude);
    event.setLongitude(longitude);
    event.setEventDate(new DateTime(eventDate));

    return event;
}
 
開發者ID:CMPUT301F17T13,項目名稱:cat-is-a-dog,代碼行數:19,代碼來源:HabitEventDataModel.java

示例15: toMap

import com.google.firebase.database.Exclude; //導入依賴的package包/類
@Exclude
public static Map<String, Object> toMap(final CheckIn checkIn) {

    final Map<String, Object> result = new HashMap<>();

    result.put("email", checkIn.email);
    result.put("checkInMessage", checkIn.checkInMessage);
    result.put("timestamp", checkIn.timestamp == null ? ServerValue.TIMESTAMP : checkIn.timestamp);

    return result;
}
 
開發者ID:thinkmobiles,項目名稱:Android-MVP-vs-MVVM-Samples,代碼行數:12,代碼來源:EntityTranslator.java


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