Java tutorial
//package com.java2s; //License from project: Apache License import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.List; public class Main { /** * Only contains transient or static fields, which is the case for a model that is empty, but * says it "implements Parcelable" * @param fields the list of fields * @return true if contains only transient and static fields, false otherwise */ private static boolean containsOnlyTransientAndStaticFields(List<Field> fields) { boolean containsNormalField = false; for (Field field : fields) { if (!Modifier.isTransient(field.getModifiers()) && !Modifier.isStatic(field.getModifiers())) { containsNormalField = true; } } return !containsNormalField; } }