GH-7: Add checkstyle and javaformat plugins

Fixes: #7

* Run `./gradlew format`
* Updates from PR review suggestions
This commit is contained in:
Chris Bono
2023-12-29 21:08:58 -06:00
committed by Artem Bilan
parent 84e732da08
commit 836708f0f2
357 changed files with 4344 additions and 4519 deletions

View File

@@ -60,8 +60,7 @@ public class SplitterFunctionConfiguration {
@ConditionalOnProperty(prefix = "splitter", name = "expression")
public AbstractMessageSplitter expressionSplitter(SplitterFunctionProperties splitterFunctionProperties) {
return new ExpressionEvaluatingSplitter(
new SpelExpressionParser()
.parseExpression(splitterFunctionProperties.getExpression()));
new SpelExpressionParser().parseExpression(splitterFunctionProperties.getExpression()));
}
@Bean
@@ -96,10 +95,12 @@ public class SplitterFunctionConfiguration {
@ConditionalOnProperty(prefix = "splitter", name = "charset")
static class Charset {
}
@ConditionalOnProperty(prefix = "splitter", name = "fileMarkers")
static class FileMarkers {
}
}

View File

@@ -37,33 +37,29 @@ public class SplitterFunctionProperties {
private String expression;
/**
* When expression is null, delimiters to use when tokenizing
* {@link String} payloads.
* When expression is null, delimiters to use when tokenizing {@link String} payloads.
*/
private String delimiters;
/**
* Set to true or false to use a {@code FileSplitter} (to split
* text-based files by line) that includes
* (or not) beginning/end of file markers.
* Set to true or false to use a {@code FileSplitter} (to split text-based files by
* line) that includes (or not) beginning/end of file markers.
*/
private Boolean fileMarkers;
/**
* When 'fileMarkers == true', specify if they should be produced
* as FileSplitter.FileMarker objects or JSON.
* When 'fileMarkers == true', specify if they should be produced as
* FileSplitter.FileMarker objects or JSON.
*/
private boolean markersJson = true;
/**
* The charset to use when converting bytes in text-based files
* to String.
* The charset to use when converting bytes in text-based files to String.
*/
private String charset;
/**
* Add correlation/sequence information in headers to facilitate later
* aggregation.
* Add correlation/sequence information in headers to facilitate later aggregation.
*/
private boolean applySequence = true;
@@ -122,7 +118,8 @@ public class SplitterFunctionProperties {
@AssertTrue(message = "File properties are not allowed when an 'expression' or 'delimiters' property is provided")
public boolean isFilePropsAllowed() {
return !(this.expression != null || this.delimiters != null) || this.fileMarkers == null && this.charset == null;
return !(this.expression != null || this.delimiters != null)
|| this.fileMarkers == null && this.charset == null;
}
}

View File

@@ -45,5 +45,7 @@ public class SplitterFunctionApplicationTests {
@SpringBootApplication
static class SplitterFunctionTestApplication {
}
}