mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
33 lines
627 B
Java
33 lines
627 B
Java
import java.util.Objects;
|
|
|
|
// "Convert record to class" "true"
|
|
final class R<T> {
|
|
private final T t;
|
|
|
|
R(T t) {
|
|
this.t = t;
|
|
}
|
|
|
|
public T t() {
|
|
return t;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) return true;
|
|
if (obj == null || obj.getClass() != this.getClass()) return false;
|
|
var that = (R) obj;
|
|
return Objects.equals(this.t, that.t);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(t);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "R[" +
|
|
"t=" + t + ']';
|
|
}
|
|
} |