what-the-bank/sources/com/huawei/hms/common/size/Size.java

63 lines
1.5 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.common.size;
import com.huawei.hms.common.internal.Objects;
/* loaded from: classes2.dex */
public class Size {
private final int a;
private final int b;
public Size(int i, int i2) {
this.a = i;
this.b = i2;
}
public static Size parseSize(String str) {
try {
int indexOf = str.indexOf("x");
if (indexOf < 0) {
indexOf = str.indexOf("*");
}
return new Size(Integer.parseInt(str.substring(0, indexOf)), Integer.parseInt(str.substring(indexOf + 1)));
} catch (Exception unused) {
throw new IllegalArgumentException("Size parses failed");
}
}
public final boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (this == obj) {
return true;
}
if (!(obj instanceof Size)) {
return false;
}
Size size = (Size) obj;
return this.a == size.a && this.b == size.b;
}
public int hashCode() {
return Objects.hashCode(Integer.valueOf(getWidth()), Integer.valueOf(getHeight()));
}
public final String toString() {
int i = this.a;
int i2 = this.b;
StringBuilder sb = new StringBuilder("Width is ");
sb.append(i);
sb.append(" Height is ");
sb.append(i2);
return sb.toString();
}
public final int getWidth() {
return this.a;
}
public final int getHeight() {
return this.b;
}
}