Skip to content

Instantly share code, notes, and snippets.

@Mercandj
Last active April 29, 2024 16:40
Show Gist options
  • Save Mercandj/0ce878739245e92908af51340e02b1bb to your computer and use it in GitHub Desktop.
Save Mercandj/0ce878739245e92908af51340e02b1bb to your computer and use it in GitHub Desktop.
public interface Response {
int getHttpCode();
}
public final class Success implements Response {
private final int httpCode;
@NotNull private final String data;
public int getHttpCode() {
return this.httpCode;
}
@NotNull public final String getData() {
return this.data;
}
public Success(int httpCode, @NotNull String data) {
Intrinsics.checkNotNullParameter(data, "data");
super();
this.httpCode = httpCode;
this.data = data;
}
public final int component1() {
return this.getHttpCode();
}
@NotNull public final String component2() {
return this.data;
}
@NotNull public final Success copy(int httpCode, @NotNull String data) {
Intrinsics.checkNotNullParameter(data, "data");
return new Success(httpCode, data);
}
// $FF: synthetic method
public static Success copy$default(Success var0, int var1, String var2, int var3, Object var4) {
if ((var3 & 1) != 0) {
var1 = var0.getHttpCode();
}
if ((var3 & 2) != 0) {
var2 = var0.data;
}
return var0.copy(var1, var2);
}
@NotNull public String toString() {
return "Success(httpCode=" + this.getHttpCode() + ", data=" + this.data + ")";
}
public int hashCode() {
int var10000 = Integer.hashCode(this.getHttpCode()) * 31;
String var10001 = this.data;
return var10000 + (var10001 != null ? var10001.hashCode() : 0);
}
public boolean equals(@Nullable Object var1) {
if (this != var1) {
if (var1 instanceof Success) {
Success var2 = (Success)var1;
if (this.getHttpCode() == var2.getHttpCode() && Intrinsics.areEqual(this.data, var2.data)) {
return true;
}
}
return false;
} else {
return true;
}
}
}
public final class Fail implements Response {
private final int httpCode;
public int getHttpCode() {
return this.httpCode;
}
public Fail(int httpCode) {
this.httpCode = httpCode;
}
public final int component1() {
return this.getHttpCode();
}
@NotNull public final Fail copy(int httpCode) {
return new Fail(httpCode);
}
// $FF: synthetic method
public static Fail copy$default(Fail var0, int var1, int var2, Object var3) {
if ((var2 & 1) != 0) {
var1 = var0.getHttpCode();
}
return var0.copy(var1);
}
@NotNull public String toString() {
return "Fail(httpCode=" + this.getHttpCode() + ")";
}
public int hashCode() {
return Integer.hashCode(this.getHttpCode());
}
public boolean equals(@Nullable Object var1) {
if (this != var1) {
if (var1 instanceof Fail) {
Fail var2 = (Fail) var1;
if (this.getHttpCode() == var2.getHttpCode()) {
return true;
}
}
return false;
} else {
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment