// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String ARRAY_END_SIGN = "]";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String ARRAY_START_SIGN = "[";
// 
// 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 SIMPLE_ARRAY_DELIMITER = ",";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/path/PathMetadata.java
// public static final String INDEXES_PATTERN = "\\s*(\\[\\s*((" + NUMBER_PATTERN + ")|\\*)\\s*]\\s*)+";


import static pl.jalokim.propertiestojson.Constants.ARRAY_END_SIGN;
import static pl.jalokim.propertiestojson.Constants.ARRAY_START_SIGN;
import static pl.jalokim.propertiestojson.Constants.EMPTY_STRING;
import static pl.jalokim.propertiestojson.Constants.SIMPLE_ARRAY_DELIMITER;
import static pl.jalokim.propertiestojson.path.PathMetadata.INDEXES_PATTERN;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;
package pl.jalokim.propertiestojson;



@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
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String ARRAY_END_SIGN = "]";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/Constants.java
// public static final String ARRAY_START_SIGN = "[";
// 
// 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 SIMPLE_ARRAY_DELIMITER = ",";
// 
// Path: src/main/java/pl/jalokim/propertiestojson/path/PathMetadata.java
// public static final String INDEXES_PATTERN = "\\s*(\\[\\s*((" + NUMBER_PATTERN + ")|\\*)\\s*]\\s*)+";


// Path: src/main/java/pl/jalokim/propertiestojson/PropertyArrayHelper.java
import static pl.jalokim.propertiestojson.Constants.ARRAY_END_SIGN;
import static pl.jalokim.propertiestojson.Constants.ARRAY_START_SIGN;
import static pl.jalokim.propertiestojson.Constants.EMPTY_STRING;
import static pl.jalokim.propertiestojson.Constants.SIMPLE_ARRAY_DELIMITER;
import static pl.jalokim.propertiestojson.path.PathMetadata.INDEXES_PATTERN;
import java.util.ArrayList;
import java.util.List;
import lombok.Getter;

package pl.jalokim.propertiestojson;



@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)