当前位置: 首页>>代码示例>>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;未经允许,请勿转载。