Back to project page AndroidWifiServer.
The source code is released under:
Apache License
If you think the Android project AndroidWifiServer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package jp.maju.wifiserver; //from w w w.jav a 2 s . c o m import java.io.Serializable; /* * Copyright {2014} {Matsuda Jumpei} * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ public class SocketInfo implements Serializable { /** * */ private static final long serialVersionUID = 4665305363410003085L; private static final String TAG = SocketInfo.class.getSimpleName(); private final String ssid; private String host; private int port = -1; private int rssi; private String kind; public SocketInfo(String ssid) { this.ssid = ssid; } public void setHost(String host) { this.host = host; } public void setKind(String kind) { this.kind = kind; } public void setPort(int port) { this.port = port; } public void setRssi(int rssi) { this.rssi = rssi; } public String getHost() { return host; } public int getPort() { return port; } public String getKind() { return kind; } public int getRssi() { return rssi; } public String getSsid() { return ssid; } @Override public String toString() { String str = this.getClass().getSimpleName() +"/ ssid="+ssid +"/ host="+host +"/ port="+port +"/ rssi="+rssi; return str; } @Override public boolean equals(Object o) { if (o == null) { return false; } if (o.getClass() != getClass()) { return false; } SocketInfo other = (SocketInfo) o; String ssid = other.getSsid(); String host = other.getHost(); int port = other.getPort(); if (host == null) { return false; } if (port < 0) { return false; } if (!this.ssid.equals(ssid)) { return false; } return this.host.equals(host) && this.port == port; } }