You put your validation in a factory. Schema.string(pattern: ...) checks that the pattern is a real regex before it hands you an object. Schema.enumeration(values) refuses an empty list and copies the one you pass in. The factory is the front door, and it has a bouncer.

Then someone calls the constructor instead.

If the concrete class has a...