William Cheng cd41bc824b
[java] Add jersey3 support to the Java client (#12046)
* add jersey3 client support

* update code to support jersey3

* test jersey3 in ci

* update doc

* update sbt, gradle build files
2022-04-05 17:23:37 +08:00

917 B

Fruit

oneOf schemas

Example

// Import classes:
import org.openapitools.client.model.Fruit;
import org.openapitools.client.model.Apple;
import org.openapitools.client.model.Banana;

public class Example {
    public static void main(String[] args) {
        Fruit exampleFruit = new Fruit();

        // create a new Apple
        Apple exampleApple = new Apple();
        // set Fruit to Apple
        exampleFruit.setActualInstance(exampleApple);
        // to get back the Apple set earlier
        Apple testApple = (Apple) exampleFruit.getActualInstance();

        // create a new Banana
        Banana exampleBanana = new Banana();
        // set Fruit to Banana
        exampleFruit.setActualInstance(exampleBanana);
        // to get back the Banana set earlier
        Banana testBanana = (Banana) exampleFruit.getActualInstance();
    }
}