Skip to content

Instantly share code, notes, and snippets.

@vgonda
Created April 17, 2017 20:44
Show Gist options
  • Save vgonda/ed87b276fe25ab3ce479d9b7877cce85 to your computer and use it in GitHub Desktop.
Save vgonda/ed87b276fe25ab3ce479d9b7877cce85 to your computer and use it in GitHub Desktop.
Decompiled Kotlin User Data Class
public final class User {
@NotNull
private final String firstName;
@Nullable
private String lastName;
public User(@NotNull String firstName, @Nullable String lastName) {
Intrinsics.checkParameterIsNotNull(firstName, "firstName");
super();
this.firstName = firstName;
this.lastName = lastName;
}
@NotNull
public final String getFirstName() {
return this.firstName;
}
@Nullable
public final String getLastName() {
return this.lastName;
}
public final void setLastName(@Nullable String var1) {
this.lastName = var1;
}
@NotNull
public final String component1() {
return this.firstName;
}
@Nullable
public final String component2() {
return this.lastName;
}
@NotNull
public final User copy(@NotNull String firstName, @Nullable String lastName) {
Intrinsics.checkParameterIsNotNull(firstName, "firstName");
return new User(firstName, lastName);
}
// $FF: synthetic method
// $FF: bridge method
@NotNull
public static User copy$default(User var0, String var1, String var2, int var3, Object var4) {
if((var3 & 1) != 0) {
var1 = var0.firstName;
}
if((var3 & 2) != 0) {
var2 = var0.lastName;
}
return var0.copy(var1, var2);
}
public String toString() {
return "User(firstName=" + this.firstName + ", lastName=" + this.lastName + ")";
}
public int hashCode() {
return (this.firstName != null?this.firstName.hashCode():0) * 31 + (this.lastName != null?this.lastName.hashCode():0);
}
public boolean equals(Object var1) {
if(this != var1) {
if(var1 instanceof User) {
User var2 = (User)var1;
if(Intrinsics.areEqual(this.firstName, var2.firstName) && Intrinsics.areEqual(this.lastName, var2.lastName)) {
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