Skip to content

Commit

Permalink
impl. validations on menuColor and menuTextColor at ParametersDto.val…
Browse files Browse the repository at this point in the history
…idate
  • Loading branch information
clagomess committed Mar 7, 2024
1 parent d4d34f7 commit 9033686
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.io.File;
import java.util.Arrays;
import java.util.regex.Pattern;

@Data
@NoArgsConstructor
Expand Down Expand Up @@ -40,8 +41,15 @@ public void validate() throws ParametersException {
if(layoutPdf == null) throw ParametersException.required("Layout PDF");
if(htmlPanelToggle == null) throw ParametersException.required("HTML Panel Toggle");

//@TODO: menuColor
//@TODO: menuTextColor
if(menuColor == null) throw ParametersException.required("Menu Color");
if(!Pattern.compile("^#[A-Fa-f0-9]{6}$").matcher(menuColor).find()){
throw new ParametersException("Option <Menu Color> must be a valid hex color");
}

if(menuTextColor == null) throw ParametersException.required("Menu Text Color");
if(!Pattern.compile("^#[A-Fa-f0-9]{6}$").matcher(menuTextColor).find()){
throw new ParametersException("Option <Menu Text Color> must be a valid hex color");
}

if(compilationType == null) throw ParametersException.required("Compilation Type");
if(compilationArtifact == null) throw ParametersException.required("Compilation Artifact");
Expand Down

0 comments on commit 9033686

Please sign in to comment.