Skip to content

Commit 088496b

Browse files
authored
Merge pull request #11 from sidhant92/antlr
rename version data type
2 parents a84f3f0 + 907f5a8 commit 088496b

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/main/java/com/github/sidhant92/boolparser/constant/DataType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ public enum DataType {
99
INTEGER,
1010
LONG,
1111
DECIMAL,
12-
APP_VERSION,
12+
VERSION,
1313
BOOLEAN
1414
}

src/main/java/com/github/sidhant92/boolparser/datatype/DataTypeFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void initialize() {
2222
abstractDataTypeMap.put(DataType.INTEGER, new IntegerDataType(objectMapper));
2323
abstractDataTypeMap.put(DataType.DECIMAL, new DecimalDataType(objectMapper));
2424
abstractDataTypeMap.put(DataType.LONG, new LongDataType(objectMapper));
25-
abstractDataTypeMap.put(DataType.APP_VERSION, new AppVersionDataType(objectMapper));
25+
abstractDataTypeMap.put(DataType.VERSION, new VersionDataType(objectMapper));
2626
abstractDataTypeMap.put(DataType.BOOLEAN, new BooleanDataType(objectMapper));
2727
}
2828

src/main/java/com/github/sidhant92/boolparser/datatype/AppVersionDataType.java renamed to src/main/java/com/github/sidhant92/boolparser/datatype/VersionDataType.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
* @author sidhant.aggarwal
1010
* @since 05/03/2023
1111
*/
12-
public class AppVersionDataType extends AbstractDataType<ComparableVersion> {
12+
public class VersionDataType extends AbstractDataType<ComparableVersion> {
1313
private final ObjectMapper objectMapper;
1414

15-
public AppVersionDataType(final ObjectMapper objectMapper) {
15+
public VersionDataType(final ObjectMapper objectMapper) {
1616
super(ComparableVersion.class);
1717
this.objectMapper = objectMapper;
1818
}
1919

2020
@Override
2121
public DataType getDataType() {
22-
return DataType.APP_VERSION;
22+
return DataType.VERSION;
2323
}
2424

2525
@Override

src/main/java/com/github/sidhant92/boolparser/parser/antlr/BooleanFilterListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private DataType getDataType(final org.antlr.v4.runtime.Token token) {
7878
case BooleanExpressionLexer.INTEGER:
7979
return ValueUtils.getNumericDataType(token.getText());
8080
case BooleanExpressionLexer.APP_VERSION:
81-
return DataType.APP_VERSION;
81+
return DataType.VERSION;
8282
case BooleanExpressionLexer.TRUE:
8383
case BooleanExpressionLexer.FALSE:
8484
return DataType.BOOLEAN;

src/main/java/com/github/sidhant92/boolparser/util/ValueUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static Object convertValue(final String value, final DataType dataType) {
1515
return Double.parseDouble(value);
1616
case BOOLEAN:
1717
return Boolean.parseBoolean(value);
18-
case APP_VERSION:
18+
case VERSION:
1919
new ComparableVersion(value);
2020
default:
2121
if (value.startsWith("'") && value.endsWith("'")) {

0 commit comments

Comments
 (0)