public class IsmnBuilder extends Object
Constructor and Description |
---|
IsmnBuilder(Dummy4j dummy4j,
ModTenFormula modTenFormula,
IsmnValidator ismnValidator) |
Modifier and Type | Method and Description |
---|---|
Ismn |
build()
Generates a random ISMN
|
IsmnBuilder |
withoutSeparator()
The generated ISMN will contain only digits and no separator
|
IsmnBuilder |
withRandomRegistrant()
Sets a random registrant for the generated ISMN.
|
IsmnBuilder |
withRandomRegistrant(String... registrants)
Sets the registrant for the generated ISMN to one that is randomly chosen from provided arguments.
|
IsmnBuilder |
withRandomSeparator()
Sets a separator for the generated ISMN to one that is randomly chosen from the yml definitions.
|
IsmnBuilder |
withRandomSeparator(String... separators)
Sets the separator for the generated ISMN to one that is randomly chosen from provided arguments
|
IsmnBuilder |
withRegistrant(String registrant)
Sets the registrant for the generated ISMN.
|
IsmnBuilder |
withSeparator(String separator)
Sets the separator used for formatting ISMN
|
public IsmnBuilder(Dummy4j dummy4j, ModTenFormula modTenFormula, IsmnValidator ismnValidator)
public IsmnBuilder withRandomRegistrant()
This is the default behavior for this builder.
public IsmnBuilder withRandomRegistrant(String... registrants)
InvalidIsmnParameterException
- when the provided arguments fail validationpublic IsmnBuilder withRegistrant(String registrant)
InvalidIsmnParameterException
- when the provided argument fails validationpublic IsmnBuilder withRandomSeparator()
This is the default behavior for this builder.
public IsmnBuilder withRandomSeparator(String... separators)
public IsmnBuilder withSeparator(String separator)
public IsmnBuilder withoutSeparator()
public Ismn build()
Copyright © 2022. All rights reserved.