10 lines
281 B
Java
10 lines
281 B
Java
package nouritsu.types;
|
|
|
|
import io.vavr.control.Either;
|
|
|
|
public record ShoppingItem(String name, Section section) {
|
|
public static Either<Resp, ShoppingItem> tryParse(String name, String category) {
|
|
return Section.tryParse(category).map(c -> new ShoppingItem(name, c));
|
|
}
|
|
}
|