Skip to content

Commit

Permalink
fix(ccls-2211): tidy up BooleanStringConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
porritta committed May 14, 2024
1 parent 234f2d8 commit f4b9783
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,15 @@
public class BooleanStringConverter implements
AttributeConverter<Boolean, String>, BasicValueConverter<Boolean, String> {

public static final BooleanStringConverter INSTANCE = new BooleanStringConverter();

/**
* Array of values which should resolve to a Boolean.TRUE.
*/
@Value("${laa.ccms.caab.converters.boolean.true_values}")
protected String[] trueValues;
protected final String[] trueValues;

/**
* Array of values which should resolve to a Boolean.FALSE.
*/
@Value("${laa.ccms.caab.converters.boolean.false_values}")
protected String[] falseValues;

public BooleanStringConverter() {
super();
}
protected final String[] falseValues;

/**
* Constructor which takes an array of true and false values.
Expand All @@ -41,7 +33,9 @@ public BooleanStringConverter() {
* @param trueValues - the true values.
* @param falseValues - the false values.
*/
protected BooleanStringConverter(final String[] trueValues, final String[] falseValues) {
protected BooleanStringConverter(
@Value("${laa.ccms.caab.converters.boolean.true_values}") final String[] trueValues,
@Value("${laa.ccms.caab.converters.boolean.false_values}") final String[] falseValues) {
this.trueValues = trueValues;
this.falseValues = falseValues;
}
Expand Down

0 comments on commit f4b9783

Please sign in to comment.