FileDocCategorySizeDatePackage
IpConfiguration.javaAPI DocAndroid 5.1 API6619Thu Mar 12 22:22:10 GMT 2015android.net

IpConfiguration

public class IpConfiguration extends Object implements android.os.Parcelable
A class representing a configured network.
hide

Fields Summary
private static final String
TAG
public IpAssignment
ipAssignment
public android.net.StaticIpConfiguration
staticIpConfiguration
public ProxySettings
proxySettings
public ProxyInfo
httpProxy
public static final Creator
CREATOR
Implement the Parcelable interface
Constructors Summary
public IpConfiguration()

        init(IpAssignment.UNASSIGNED, ProxySettings.UNASSIGNED, null, null);
    
public IpConfiguration(IpAssignment ipAssignment, ProxySettings proxySettings, android.net.StaticIpConfiguration staticIpConfiguration, ProxyInfo httpProxy)

        init(ipAssignment, proxySettings, staticIpConfiguration, httpProxy);
    
public IpConfiguration(IpConfiguration source)

        this();
        if (source != null) {
            init(source.ipAssignment, source.proxySettings,
                 source.staticIpConfiguration, source.httpProxy);
        }
    
Methods Summary
public intdescribeContents()
Implement the Parcelable interface

        return 0;
    
public booleanequals(java.lang.Object o)

        if (o == this) {
            return true;
        }

        if (!(o instanceof IpConfiguration)) {
            return false;
        }

        IpConfiguration other = (IpConfiguration) o;
        return this.ipAssignment == other.ipAssignment &&
                this.proxySettings == other.proxySettings &&
                Objects.equals(this.staticIpConfiguration, other.staticIpConfiguration) &&
                Objects.equals(this.httpProxy, other.httpProxy);
    
public ProxyInfogetHttpProxy()

        return httpProxy;
    
public android.net.IpConfiguration$IpAssignmentgetIpAssignment()

        return ipAssignment;
    
public android.net.IpConfiguration$ProxySettingsgetProxySettings()

        return proxySettings;
    
public android.net.StaticIpConfigurationgetStaticIpConfiguration()

        return staticIpConfiguration;
    
public inthashCode()

        return 13 + (staticIpConfiguration != null ? staticIpConfiguration.hashCode() : 0) +
               17 * ipAssignment.ordinal() +
               47 * proxySettings.ordinal() +
               83 * httpProxy.hashCode();
    
private voidinit(android.net.IpConfiguration$IpAssignment ipAssignment, android.net.IpConfiguration$ProxySettings proxySettings, android.net.StaticIpConfiguration staticIpConfiguration, ProxyInfo httpProxy)


       
                       
                       
                        
        this.ipAssignment = ipAssignment;
        this.proxySettings = proxySettings;
        this.staticIpConfiguration = (staticIpConfiguration == null) ?
                null : new StaticIpConfiguration(staticIpConfiguration);
        this.httpProxy = (httpProxy == null) ?
                null : new ProxyInfo(httpProxy);
    
public voidsetHttpProxy(ProxyInfo httpProxy)

        this.httpProxy = httpProxy;
    
public voidsetIpAssignment(android.net.IpConfiguration$IpAssignment ipAssignment)

        this.ipAssignment = ipAssignment;
    
public voidsetProxySettings(android.net.IpConfiguration$ProxySettings proxySettings)

        this.proxySettings = proxySettings;
    
public voidsetStaticIpConfiguration(android.net.StaticIpConfiguration staticIpConfiguration)

        this.staticIpConfiguration = staticIpConfiguration;
    
public java.lang.StringtoString()

        StringBuilder sbuf = new StringBuilder();
        sbuf.append("IP assignment: " + ipAssignment.toString());
        sbuf.append("\n");
        if (staticIpConfiguration != null) {
            sbuf.append("Static configuration: " + staticIpConfiguration.toString());
            sbuf.append("\n");
        }
        sbuf.append("Proxy settings: " + proxySettings.toString());
        sbuf.append("\n");
        if (httpProxy != null) {
            sbuf.append("HTTP proxy: " + httpProxy.toString());
            sbuf.append("\n");
        }

        return sbuf.toString();
    
public voidwriteToParcel(android.os.Parcel dest, int flags)
Implement the Parcelable interface

        dest.writeString(ipAssignment.name());
        dest.writeString(proxySettings.name());
        dest.writeParcelable(staticIpConfiguration, flags);
        dest.writeParcelable(httpProxy, flags);