what-the-bank/sources/net/sf/scuba/smartcards/CardEvent.java

70 lines
1.8 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package net.sf.scuba.smartcards;
import java.util.EventObject;
/* loaded from: classes6.dex */
public class CardEvent extends EventObject {
public static final int INSERTED = 1;
public static final int REMOVED = 0;
private static final long serialVersionUID = -5645277246646615351L;
private CardService service;
private int type;
public CardEvent(int i, CardService cardService) {
super(cardService);
this.type = i;
this.service = cardService;
}
@Override // java.util.EventObject
public String toString() {
int i = this.type;
if (i == 0) {
StringBuilder sb = new StringBuilder("Card removed from ");
sb.append(this.service);
return sb.toString();
}
if (i == 1) {
StringBuilder sb2 = new StringBuilder("Card inserted in ");
sb2.append(this.service);
return sb2.toString();
}
StringBuilder sb3 = new StringBuilder("CardEvent ");
sb3.append(this.service);
return sb3.toString();
}
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
try {
if (!obj.getClass().equals(getClass())) {
return false;
}
CardEvent cardEvent = (CardEvent) obj;
if (this.type == cardEvent.type) {
return this.service.equals(cardEvent.service);
}
return false;
} catch (ClassCastException unused) {
return false;
}
}
public int hashCode() {
return (this.service.hashCode() * 5) + (this.type * 7);
}
public int getType() {
return this.type;
}
public CardService getService() {
return this.service;
}
}