11package com .github .sidhant92 .boolparser .util ;
22
3+ import java .util .Arrays ;
34import java .util .Map ;
45import java .util .Optional ;
6+ import java .util .stream .Collectors ;
57import org .apache .maven .artifact .versioning .ComparableVersion ;
68import com .github .sidhant92 .boolparser .constant .DataType ;
79import lombok .extern .slf4j .Slf4j ;
@@ -17,7 +19,10 @@ public static Optional<Object> getValueFromMap(final String key, final Map<Strin
1719 }
1820 if (fieldData .isPresent () && fieldData .get () instanceof Map ) {
1921 try {
20- return getValueFromMap (keys [1 ], (Map <String , Object >) fieldData .get ());
22+ final String newKey = Arrays
23+ .stream (keys ).skip (1 )
24+ .collect (Collectors .joining ("." ));
25+ return getValueFromMap (newKey , (Map <String , Object >) fieldData .get ());
2126 } catch (ClassCastException ex ) {
2227 return Optional .empty ();
2328 }
@@ -40,10 +45,10 @@ public static Object convertValue(final String value, final DataType dataType) {
4045 new ComparableVersion (value );
4146 default :
4247 if (value .startsWith ("'" ) && value .endsWith ("'" )) {
43- return value .substring (1 , value .length () -1 );
48+ return value .substring (1 , value .length () - 1 );
4449 }
4550 if (value .startsWith ("\" " ) && value .endsWith ("\" " )) {
46- return value .substring (1 , value .length () -1 );
51+ return value .substring (1 , value .length () - 1 );
4752 }
4853 return value ;
4954 }
0 commit comments