@@ -0,0 +1,2602 @@
+package io.particle.android.sdk.utils;%0A%0Aimport android.net.wifi.ScanResult;%0Aimport android.net.wifi.WifiConfiguration;%0Aimport android.net.wifi.WifiInfo;%0Aimport android.os.Parcel;%0Aimport android.os.Parcelable;%0Aimport android.support.annotation.NonNull;%0A%0A%0A/**%0A * Simple value wrapper for SSID strings.  Eliminates case comparison issues and the quoting%0A * nonsense introduced by %7B@link android.net.wifi.WifiConfiguration#SSID%7D (and potentially elsewhere)%0A */%0Apublic class SSID implements Comparable%3CSSID%3E, Parcelable %7B%0A%0A    public static SSID from(@NonNull String rawSsidString) %7B%0A        Preconditions.checkNotNull(rawSsidString);%0A        return new SSID(deQuotifySsid(rawSsidString));%0A    %7D%0A%0A    public static SSID from(WifiInfo wifiInfo) %7B%0A        return from(wifiInfo.getSSID());%0A    %7D%0A%0A    public static SSID from(WifiConfiguration wifiConfiguration) %7B%0A        return from(wifiConfiguration.SSID);%0A    %7D%0A%0A    public static SSID from(ScanResult scanResult) %7B%0A        return SSID.from(scanResult.SSID);%0A    %7D%0A%0A%0A    private final String ssidString;%0A%0A    private SSID(String ssidString) %7B%0A        this.ssidString = ssidString;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return ssidString;%0A    %7D%0A%0A    public String inQuotes() %7B%0A        return %22%5C%22%22 + ssidString + %22%5C%22%22;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) return true;%0A        if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A        SSID ssid = (SSID) o;%0A%0A        return ssidString.equalsIgnoreCase(ssid.ssidString);%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return ssidString.toLowerCase().hashCode();%0A    %7D%0A%0A    @Override%0A    public int compareTo(@NonNull SSID o) %7B%0A        return ssidString.compareToIgnoreCase(o.ssidString);%0A    %7D%0A%0A    private static String deQuotifySsid(String SSID) %7B%0A        String quoteMark = %22%5C%22%22;%0A        SSID = ParticleDeviceSetupInternalStringUtils.removeStart(SSID, quoteMark);%0A        SSID = ParticleDeviceSetupInternalStringUtils.removeEnd(SSID, quoteMark);%0A        return SSID;%0A    %7D%0A%0A%0A    //region Parcelable noise%0A    @Override%0A    public int describeContents() %7B%0A        return 0;%0A    %7D%0A%0A    @Override%0A    public void writeToParcel(Parcel dest, int flags) %7B%0A        dest.writeString(ssidString);%0A    %7D%0A%0A    public static final Creator%3CSSID%3E CREATOR = new Creator%3CSSID%3E() %7B%0A        @Override%0A        public SSID createFromParcel(Parcel in) %7B%0A            return new SSID(in.readString());%0A        %7D%0A%0A        @Override%0A        public SSID%5B%5D newArray(int size) %7B%0A            return new SSID%5Bsize%5D;%0A        %7D%0A    %7D;%0A    //endregion%0A%7D%0A

Introduce SSID class to eliminate confusing, error-prone quote handling all over the place, and avoid using the wrong string value in argument lists