// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String EMPTY_STRING = "";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String NORMAL_DOT = ".";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/PropertyArrayHelper.java
// @Getter
// public class PropertyArrayHelper {
// 
//     private List<Integer> dimensionalIndexes;
//     private String arrayFieldName;
// 
//     public PropertyArrayHelper(String field) {
//         arrayFieldName = getNameFromArray(field);
//         dimensionalIndexes = getIndexesFromArrayField(field);
//     }
// 
//     public static String getNameFromArray(String fieldName) {
//         return fieldName.replaceFirst(INDEXES_PATTERN + "$", EMPTY_STRING);
//     }
// 
//     public static List<Integer> getIndexesFromArrayField(String fieldName) {
//         String indexesAsText = fieldName.replace(getNameFromArray(fieldName), EMPTY_STRING);
//         String[] indexesAsTextArray = indexesAsText
//             .replace(ARRAY_START_SIGN, EMPTY_STRING)
//             .replace(ARRAY_END_SIGN, SIMPLE_ARRAY_DELIMITER)
//             .replaceAll("\\s", EMPTY_STRING)
//             .split(SIMPLE_ARRAY_DELIMITER);
//         List<Integer> indexes = new ArrayList<>();
//         for (String indexAsText : indexesAsTextArray) {
//             indexes.add(Integer.valueOf(indexAsText));
//         }
//         return indexes;
//     }
// }
// 
// Path: src/main/java/pl/jalokim/propertiestojson/exception/NotLeafValueException.java
// public class NotLeafValueException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public NotLeafValueException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/pl/jalokim/propertiestojson/object/AbstractJsonType.java
// public abstract class AbstractJsonType {
// 
//     /**
//      * This one simply concatenate to rest of json. Simply speaking when will not converted then will not create whole json correctly.
//      *
//      * @return string for part of json.
//      */
//     public abstract String toStringJson();
// 
//     @Override
//     public final String toString() {
//         return toStringJson();
//     }
// }


import static pl.jalokim.propertiestojson.Constants.EMPTY_STRING;
import static pl.jalokim.propertiestojson.Constants.NORMAL_DOT;
import lombok.Data;
import pl.jalokim.propertiestojson.PropertyArrayHelper;
import pl.jalokim.propertiestojson.exception.NotLeafValueException;
import pl.jalokim.propertiestojson.object.AbstractJsonType;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
        if (fieldName.matches(WORD_PATTERN + INDEXES_PATTERN)) {
            propertyArrayHelper = new PropertyArrayHelper(fieldName);
            this.fieldName = propertyArrayHelper.getArrayFieldName();
        }
    }

    public void setRawValue(Object rawValue) {
        if (!isLeaf()) {
            throw new NotLeafValueException("Cannot set value for not leaf: " + getCurrentFullPath());
        }
        this.rawValue = rawValue;
    }

    public String getOriginalPropertyKey() {
        return originalPropertyKey;
    }

    public PathMetadata getRoot() {
        PathMetadata current = this;
        while (current.getParent() != null) {
            current = current.getParent();
        }
        return current;
    }

    public String getCurrentFullPathWithoutIndexes() {
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String EMPTY_STRING = "";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String NORMAL_DOT = ".";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/PropertyArrayHelper.java
// @Getter
// public class PropertyArrayHelper {
// 
//     private List<Integer> dimensionalIndexes;
//     private String arrayFieldName;
// 
//     public PropertyArrayHelper(String field) {
//         arrayFieldName = getNameFromArray(field);
//         dimensionalIndexes = getIndexesFromArrayField(field);
//     }
// 
//     public static String getNameFromArray(String fieldName) {
//         return fieldName.replaceFirst(INDEXES_PATTERN + "$", EMPTY_STRING);
//     }
// 
//     public static List<Integer> getIndexesFromArrayField(String fieldName) {
//         String indexesAsText = fieldName.replace(getNameFromArray(fieldName), EMPTY_STRING);
//         String[] indexesAsTextArray = indexesAsText
//             .replace(ARRAY_START_SIGN, EMPTY_STRING)
//             .replace(ARRAY_END_SIGN, SIMPLE_ARRAY_DELIMITER)
//             .replaceAll("\\s", EMPTY_STRING)
//             .split(SIMPLE_ARRAY_DELIMITER);
//         List<Integer> indexes = new ArrayList<>();
//         for (String indexAsText : indexesAsTextArray) {
//             indexes.add(Integer.valueOf(indexAsText));
//         }
//         return indexes;
//     }
// }
// 
// Path: src/main/java/pl/jalokim/propertiestojson/exception/NotLeafValueException.java
// public class NotLeafValueException extends RuntimeException {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public NotLeafValueException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/pl/jalokim/propertiestojson/object/AbstractJsonType.java
// public abstract class AbstractJsonType {
// 
//     /**
//      * This one simply concatenate to rest of json. Simply speaking when will not converted then will not create whole json correctly.
//      *
//      * @return string for part of json.
//      */
//     public abstract String toStringJson();
// 
//     @Override
//     public final String toString() {
//         return toStringJson();
//     }
// }


// Path: src/main/java/pl/jalokim/propertiestojson/path/PathMetadata.java
import static pl.jalokim.propertiestojson.Constants.EMPTY_STRING;
import static pl.jalokim.propertiestojson.Constants.NORMAL_DOT;
import lombok.Data;
import pl.jalokim.propertiestojson.PropertyArrayHelper;
import pl.jalokim.propertiestojson.exception.NotLeafValueException;
import pl.jalokim.propertiestojson.object.AbstractJsonType;

    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
        if (fieldName.matches(WORD_PATTERN + INDEXES_PATTERN)) {
            propertyArrayHelper = new PropertyArrayHelper(fieldName);
            this.fieldName = propertyArrayHelper.getArrayFieldName();
        }
    }

    public void setRawValue(Object rawValue) {
        if (!isLeaf()) {
            throw new NotLeafValueException("Cannot set value for not leaf: " + getCurrentFullPath());
        }
        this.rawValue = rawValue;
    }

    public String getOriginalPropertyKey() {
        return originalPropertyKey;
    }

    public PathMetadata getRoot() {
        PathMetadata current = this;
        while (current.getParent() != null) {
            current = current.getParent();
        }
        return current;
    }

    public String getCurrentFullPathWithoutIndexes() {
        String parentFullPath = isRoot() ? EMPTY_STRING : getParent().getCurrentFullPath() + NORMAL_DOT;