package com.amazon.ads.ema.api.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Ethernet connection information
 */
public class EthernetInfo implements Parcelable {
    public static final Creator<EthernetInfo> CREATOR = new Creator<>() {
        @Override
        public EthernetInfo createFromParcel(Parcel in) {
            return new EthernetInfo(in);
        }

        @Override
        public EthernetInfo[] newArray(int size) {
            return new EthernetInfo[size];
        }
    };
    public boolean connected;
    public String ipAddress;
    public String macAddress;

    public EthernetInfo() {
    }

    protected EthernetInfo(Parcel in) {
        connected = in.readByte() != 0;
        ipAddress = in.readString();
        macAddress = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte((byte) (connected ? 1 : 0));
        dest.writeString(ipAddress);
        dest.writeString(macAddress);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
