is class implementing Serializable - Android java.lang.reflect

Android examples for java.lang.reflect:interface

Description

is class implementing Serializable

Demo Code


import java.io.Serializable;
import java.lang.reflect.Field;
import android.os.Bundle;
import android.os.Parcelable;

public class Main{
    //w  w w .j  ava  2s . c om
    private static boolean isImplementSerializable(Class clazz) {
        Class[] interfaces = clazz.getInterfaces();
        if (interfaces.length == 0) {
            return false;
        }
        for (Class i : interfaces) {
            if (i == Serializable.class) {
                return true;
            }
        }
        return false;
    }
}

Related Tutorials