本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
};
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}