package vut.msa.monitor.system;

import org.hyperic.sigar.NetInterfaceConfig;
import org.hyperic.sigar.NetInterfaceStat;

/**
 * Wrapper pre informacie o sieti
 */
public class NetCompleteInfo {

    private NetInterfaceConfig config;
    private NetInterfaceStat stat;

    public NetCompleteInfo (NetInterfaceConfig config, NetInterfaceStat stat) {
        this.config = config;
        this.stat = stat;
    }

    //PROPERTY: config
    public NetInterfaceConfig getConfig() { return config; }
    public void setConfig(NetInterfaceConfig config) { this.config = config; }

    //PROPERTY: stat
    public NetInterfaceStat getStat() { return stat; }
    public void setStat(NetInterfaceStat stat) { this.stat = stat; }

    /**
     * Metoda zistuje, ci typ sietoveho adaptera je Ethernet.
     *
     * @return true, ak je Ethernet;, false, ak nie.
     */
    public boolean isEthernet() {
        return (config.getType().equals("Ethernet"));
    }

    /**
     * Metoda zistuje, ci typ sietoveho adaptera je Local loopback.
     *
     * @return true, ak je Local loopback;, false, ak nie.
     */
    public boolean isLoopback() {
        return (config.getType().equals("Local Loopback"));
    }
}
