mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-29 04:45:04 +07:00
GitOrigin-RevId: d6f5fb8b21e233edd636f5ee315e5e7b167f9b91
38 lines
788 B
Java
38 lines
788 B
Java
// "Convert record to class" "true-preview"
|
|
import java.lang.annotation.*;
|
|
import java.util.Objects;
|
|
|
|
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE_USE})
|
|
@interface Anno {}
|
|
|
|
final class R {
|
|
private final @Anno int f;
|
|
|
|
R(@Anno int f) {
|
|
this.f = f;
|
|
}
|
|
|
|
public @Anno int f() {
|
|
return f;
|
|
}
|
|
|
|
@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 this.f == that.f;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(f);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "R[" +
|
|
"f=" + f + ']';
|
|
}
|
|
}
|