bbottema/lorem-ipsum-objects

Enum with One Value

Closed this issue · 1 comments

When i Have an Enum with One value I got this error

ERROR org.bbottema.loremipsumobjects.typefactories.ClassBasedFactory - error logged:
java.lang.IllegalArgumentException: bound must be positive
	at java.base/java.util.concurrent.ThreadLocalRandom.nextInt(ThreadLocalRandom.java:310)

Yes There is always a solution by using ClassBindings for my specific enum like

result.bind(SingleTypeEnum.class, new FixedInstanceFactory<>(SingleTypeEnum.TYPE1));

Closed as duplicate of #20 (let's keep the discussion there).