@@ -130,22 +130,24 @@ public EncodedCodesOptions build() {
130130 }
131131 }
132132
133- public static EncodedCodesOptions fromJsonObject (Project project , JsonObject object ) {
134- String format = JsonUtils .getStringOpt (object , "format" , "simple" );
133+ public static EncodedCodesOptions fromJsonObject (Project project , JsonObject jsonObject ) {
134+ String format = JsonUtils .getStringOpt (jsonObject , "format" , "simple" );
135+ String separator = JsonUtils .getStringOpt (jsonObject , "separator" , "\n " );
136+
135137 switch (format ) {
136138 case "csv" :
137139 return new EncodedCodesOptions .Builder (project )
138- .prefix ("snabble;{qrCodeCount};{count}\n " )
139- .separator (" \n " )
140+ .prefix ("snabble;{qrCodeCount};{count}" + separator )
141+ .separator (separator )
140142 .suffix ("" )
141143 .repeatCodes (false )
142144 .countSeparator (";" )
143145 .maxCodes (100 )
144146 .build ();
145147 case "csv_globus" :
146148 return new EncodedCodesOptions .Builder (project )
147- .prefix ("snabble;\n " )
148- .separator (" \n " )
149+ .prefix ("snabble;" + separator )
150+ .separator (separator )
149151 .suffix ("" )
150152 .repeatCodes (false )
151153 .countSeparator (";" )
@@ -179,15 +181,15 @@ public static EncodedCodesOptions fromJsonObject(Project project, JsonObject obj
179181 case "simple" :
180182 default :
181183 return new EncodedCodesOptions .Builder (project )
182- .prefix (JsonUtils .getStringOpt (object , "prefix" , "" ))
183- .separator (JsonUtils .getStringOpt (object , "separator" , "\n " ))
184- .suffix (JsonUtils .getStringOpt (object , "suffix" , "" ))
185- .maxCodes (JsonUtils .getIntOpt (object , "maxCodes" , 100 ))
186- .finalCode (JsonUtils .getStringOpt (object , "finalCode" , "" ))
187- .nextCode (JsonUtils .getStringOpt (object , "nextCode" , "" ))
188- .nextCodeWithCheck (JsonUtils .getStringOpt (object , "nextCodeWithCheck" , "" ))
189- .maxSizeMm (JsonUtils .getIntOpt (object , "maxSizeMM" , -1 ))
190- .maxChars (JsonUtils .getIntOpt (object , "maxChars" , EncodedCodesOptions .DEFAULT_MAX_CHARS ))
184+ .prefix (JsonUtils .getStringOpt (jsonObject , "prefix" , "" ))
185+ .separator (JsonUtils .getStringOpt (jsonObject , "separator" , "\n " ))
186+ .suffix (JsonUtils .getStringOpt (jsonObject , "suffix" , "" ))
187+ .maxCodes (JsonUtils .getIntOpt (jsonObject , "maxCodes" , 100 ))
188+ .finalCode (JsonUtils .getStringOpt (jsonObject , "finalCode" , "" ))
189+ .nextCode (JsonUtils .getStringOpt (jsonObject , "nextCode" , "" ))
190+ .nextCodeWithCheck (JsonUtils .getStringOpt (jsonObject , "nextCodeWithCheck" , "" ))
191+ .maxSizeMm (JsonUtils .getIntOpt (jsonObject , "maxSizeMM" , -1 ))
192+ .maxChars (JsonUtils .getIntOpt (jsonObject , "maxChars" , EncodedCodesOptions .DEFAULT_MAX_CHARS ))
191193 .build ();
192194 }
193195 }
0 commit comments