org.catools.common.facker.provider.CFakerStreetAddressProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-randomize Show documentation
Show all versions of common-randomize Show documentation
The Common Randomize Implementation
package org.catools.common.facker.provider;
import com.mifmif.common.regex.Generex;
import lombok.AllArgsConstructor;
import org.catools.common.collections.CList;
import org.catools.common.facker.model.CRandomStreetInfo;
@AllArgsConstructor
public class CFakerStreetAddressProvider {
private final CList streetNames;
private final CList streetSuffixes;
private final CList streetPrefixes;
private final CList streetNumberPatterns;
private final CList buildingNumberPatterns;
public CRandomStreetInfo getAny() {
return new CRandomStreetInfo(streetNames.getAny(),
streetSuffixes.getAny(),
streetPrefixes.getAny(),
new Generex(streetNumberPatterns.getAny()).random(),
new Generex(buildingNumberPatterns.getAny()).random());
}
}