package core.operation.utils;

import java.util.HashMap;
import java.util.Map;

public interface util {
    static String stringOptionsFormat(String options){
        return options.replaceAll(" {2,}", " ") ;
    }
    static Map<String, Object> string2MapOptions(String sOptions){
        sOptions = stringOptionsFormat(sOptions);
        Map<String, Object> options = new HashMap<>();
        String[] sOpts = sOptions.split(" ");
        for(int i=0;i<sOpts.length;i++){
            options.put(sOpts[i],sOpts[++i]);
        }
        return options;
    }
}
