William Cheng 4ecb9f4186
[java][native] Fix urlQuery string method in oneOf (#14488)
* better tests, fix oneOf in urlquery string method

* update samples

* update
2023-01-20 01:57:32 +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();
    }
}