@Override
 public boolean equals(final Object obj) {
   if (this == obj) return true;
   if (obj == null) return false;
   if (!(obj instanceof SingleResponse)) return false;
   final SingleResponse<?> other = (SingleResponse<?>) obj;
   if (data == null) {
     if (other.data != null) return false;
   } else if (!data.equals(other.data)) return false;
   if (exception == null) {
     if (other.exception != null) return false;
   } else if (!exception.equals(other.exception)) return false;
   if (extras == null) {
     if (other.extras != null) return false;
   } else if (!extras.equals(other.extras)) return false;
   return true;
 }
Example #2
0
 public static void updateFromMessage(StatusMessage s, Message m) {
   Bundle b = m.getData();
   if (b.containsKey(SSID_KEY)
       && b.getString(SSID_KEY) != null
       && b.getString(SSID_KEY).length() > 1)
     if (!b.equals(s.getSSID())) s.setSSID(b.getString(SSID_KEY));
   if (b.containsKey(STATUS_KEY)
       && b.getString(STATUS_KEY) != null
       && b.getString(STATUS_KEY).length() > 1)
     if (!b.equals(s.getStatus())) s.setStatus(b.getString(STATUS_KEY));
   if (b.containsKey(SIGNAL_KEY) && b.getInt(SIGNAL_KEY) != s.getSignal())
     s.setSignal(b.getInt(SIGNAL_KEY));
   if (b.containsKey(SHOW_KEY) && b.getInt(SHOW_KEY) != 0)
     if (b.getInt(SHOW_KEY) != s.getShow()) s.setShow(b.getInt(SHOW_KEY));
   if (b.containsKey(LINK_KEY)) {
     String ls = b.getString(LINK_KEY);
     if (ls != null && !ls.contains(MB)) s.setLinkSpeed(ls.concat(MB));
   }
 }