You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation:
With the latest changes, we can write:
```java
doSwitch()
.on(
Choice.withKey("key1", chain1, chain2, chain3),
Choice.withKey(key2", chain4, chain5),
)
randomSwitch()
.on(
Choice.withWeight(double1, chain1, chain2, chain3),
Choice.withWeight(double2, chain4, chain5),
)
```
This doesn't format nicely, in particular when chains are not references but inline.
Modifications:
We should separate the key and weight from the chains.
```java
doSwitch()
.on(
onCase("key1").then(chain1, chain2, chain3),
onCase(key2").then(chain4, chain5),
)
randomSwitch()
.on(
withWeight(double1).then(chain1, chain2, chain3),
withWeight(double2).then(chain4, chain5),
)
```
The existing Choice static factories are deprecated and will be removed in the next release.
Motivation:
With the latest changes, we can write:
```java
doSwitch()
.on(
Choice.withKey("key1", chain1, chain2, chain3),
Choice.withKey(key2", chain4, chain5),
)
randomSwitch()
.on(
Choice.withWeight(double1, chain1, chain2, chain3),
Choice.withWeight(double2, chain4, chain5),
)
```
This doesn't format nicely, in particular when chains are not references but inline.
Modifications:
We should separate the key and weight from the chains.
```java
doSwitch()
.on(
onCase("key1").then(chain1, chain2, chain3),
onCase(key2").then(chain4, chain5),
)
randomSwitch()
.on(
withWeight(double1).then(chain1, chain2, chain3),
withWeight(double2).then(chain4, chain5),
)
```
The existing Choice static factories are deprecated and will be removed in the next release.
With the latest changes, we can write:
This doesn't format nicely, in particular when chains are not references but inline.
We should separate the key and weight from the chains.
The text was updated successfully, but these errors were encountered: