Last active
November 11, 2018 19:54
-
-
Save ozcanzaferayan/2dd10c321a88fba554cfaf82fc82776e to your computer and use it in GitHub Desktop.
Kotlin Nedir 2: Java data class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.ozcanzaferayan.testkotlin; | |
import kotlin.Metadata; | |
import kotlin.jvm.internal.Intrinsics; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
@Metadata( | |
mv = {1, 1, 11}, | |
bv = {1, 0, 2}, | |
k = 1, | |
d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\r\n\u0002\u0010\u000b\n\u0002\b\u0004\b\u0086\b\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\t\u0010\u000f\u001a\u00020\u0003HÆ\u0003J\t\u0010\u0010\u001a\u00020\u0005HÆ\u0003J\u001d\u0010\u0011\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u0005HÆ\u0001J\u0013\u0010\u0012\u001a\u00020\u00132\b\u0010\u0014\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u0015\u001a\u00020\u0005HÖ\u0001J\t\u0010\u0016\u001a\u00020\u0003HÖ\u0001R\u001a\u0010\u0004\u001a\u00020\u0005X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001a\u0010\u0002\u001a\u00020\u0003X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000e¨\u0006\u0017"}, | |
d2 = {"Lcom/example/ozcanzaferayan/testkotlin/User;", "", "name", "", "age", "", "(Ljava/lang/String;I)V", "getAge", "()I", "setAge", "(I)V", "getName", "()Ljava/lang/String;", "setName", "(Ljava/lang/String;)V", "component1", "component2", "copy", "equals", "", "other", "hashCode", "toString", "app_debug"} | |
) | |
public final class User { | |
@NotNull | |
private String name; | |
private int age; | |
@NotNull | |
public final String getName() { | |
return this.name; | |
} | |
public final void setName(@NotNull String var1) { | |
Intrinsics.checkParameterIsNotNull(var1, "<set-?>"); | |
this.name = var1; | |
} | |
public final int getAge() { | |
return this.age; | |
} | |
public final void setAge(int var1) { | |
this.age = var1; | |
} | |
public User(@NotNull String name, int age) { | |
Intrinsics.checkParameterIsNotNull(name, "name"); | |
super(); | |
this.name = name; | |
this.age = age; | |
} | |
@NotNull | |
public final String component1() { | |
return this.name; | |
} | |
public final int component2() { | |
return this.age; | |
} | |
@NotNull | |
public final User copy(@NotNull String name, int age) { | |
Intrinsics.checkParameterIsNotNull(name, "name"); | |
return new User(name, age); | |
} | |
// $FF: synthetic method | |
// $FF: bridge method | |
@NotNull | |
public static User copy$default(User var0, String var1, int var2, int var3, Object var4) { | |
if ((var3 & 1) != 0) { | |
var1 = var0.name; | |
} | |
if ((var3 & 2) != 0) { | |
var2 = var0.age; | |
} | |
return var0.copy(var1, var2); | |
} | |
@NotNull | |
public String toString() { | |
return "User(name=" + this.name + ", age=" + this.age + ")"; | |
} | |
public int hashCode() { | |
return (this.name != null ? this.name.hashCode() : 0) * 31 + this.age; | |
} | |
public boolean equals(@Nullable Object var1) { | |
if (this != var1) { | |
if (var1 instanceof User) { | |
User var2 = (User)var1; | |
if (Intrinsics.areEqual(this.name, var2.name) && this.age == var2.age) { | |
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