I would say it is going to be something like this:
import org.jetbrains.annotations.NotNull;
public class ContactDataa {
@NotNull
private final String name;
private final boolean online;
public ContactDataa() {
this("", false);
}
public ContactDataa(final String name) {
this(name, false);
}
public ContactDataa(final boolean online) {
this("", online);
}
public ContactDataa(final String name, final boolean online) {
if (name == null) {
throw new IllegalArgumentException();
}
this.name = name;
this.online = online;
}
public String getName() {
return name;
}
public boolean isOnline() {
return online;
}
public String component1() {
return name;
}
public boolean component2() {
return online;
}
@NotNull
public final ContactData copy(@NotNull String name, boolean online) {
if (name == null) {
throw new IllegalArgumentException();
}
return new ContactData(name, online);
}
@NotNull
public final ContactData copy(@NotNull String name) {
if (name == null) {
throw new IllegalArgumentException();
}
return new ContactData(name, online);
}
@NotNull
public final ContactData copy(boolean online) {
return new ContactData(name, online);
}
@NotNull
public final ContactData copy() {
return new ContactData(name, online);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ContactDataa that = (ContactDataa) o;
if (online != that.online) return false;
return name != null ? name.equals(that.name) : that.name == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (online ? 1 : 0);
return result;
}
@Override
public String toString() {
return "ContactDataa{" +
"name='" + name + '\'' +
", online=" + online +
'}';
}
}
Problem here is a complete intertop with other Kotlin's classes. Also, if you use Intellij IDEA or Android Studio, you can just get Kotlin bytecode and decompile it to Java.