1

I want to specify my Class as a value-type one, so it can be stacked in method calls.

I tried the @jdk.internal.ValueBased annotation but it is not exposed from its module. The doco gives a list of required properties, but does not say how to declare it.

If the compiler is left to its own judgment (in deciding to make a Class value-based or not), how can I tell which decision it took?

Note: this is Dec 2022, so the current target is Java 19

Perdi Estaquel
  • 819
  • 1
  • 6
  • 21
  • 3
    Value Objects have not reached Incubator/Preview status yet which is why the feature is not availalbe in the current JDK. The [corresponding JEP](https://openjdk.org/jeps/8277163) is still a draft. You can [download the Valhalla](https://github.com/openjdk/valhalla) version of the JDK for testing purposes from GitHub. – Alex R Dec 29 '22 at 08:05
  • 1
    Thx Alex, found a more convenient binaries download in [Project Valhalla Early-Access Builds](https://jdk.java.net/valhalla/) – Perdi Estaquel Dec 29 '22 at 08:55

0 Answers0