Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Comments

Use enums with explicit values and add missing FieldType enums#103

Merged
jspaetzel merged 3 commits intomasterfrom
explicit_enums
Apr 21, 2020
Merged

Use enums with explicit values and add missing FieldType enums#103
jspaetzel merged 3 commits intomasterfrom
explicit_enums

Conversation

@jspaetzel
Copy link
Member

@jspaetzel jspaetzel commented Feb 26, 2020

Changed how this is done mainly because TEXT_MERGE("text-merge"); and others with dashes can't be defined as an enum like text-merge.

@jspaetzel jspaetzel added the wip label Feb 26, 2020
@jspaetzel jspaetzel changed the title Use enums with explicit values and add missing enums Use enums with explicit values and add missing enums #102 Feb 26, 2020
@jspaetzel jspaetzel changed the title Use enums with explicit values and add missing enums #102 Use enums with explicit values and add missing enums Feb 26, 2020
@jspaetzel jspaetzel linked an issue Feb 26, 2020 that may be closed by this pull request
@jspaetzel jspaetzel changed the title Use enums with explicit values and add missing enums Use enums with explicit values and add missing FieldType enums Feb 28, 2020
Comment on lines +153 to +165
List<FieldType> mergeableFieldTypes = Arrays.asList(
FieldType.CHECKBOX,
FieldType.TEXT
);

if (!mergeableFieldTypes.contains(type)) {
List<String> asStrings = mergeableFieldTypes
.stream()
.map(Enum::toString)
.collect(Collectors.toList());
throw new HelloSignException(
"Only 'text' or 'checkbox' types allowed for merge fields.");
String.format("Only %s types allowed for merge fields.", String.join(",", asStrings))
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was unnecessary since we're not actually adding any other types. I might revert this part.

@jspaetzel jspaetzel removed the wip label Apr 21, 2020
@jspaetzel jspaetzel merged commit 99b272b into master Apr 21, 2020
@jspaetzel jspaetzel deleted the explicit_enums branch April 21, 2020 01:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing formfields TYPE parameterr

1 participant