private List<String> getFieldPath(String field) {
        String[] paths = field.split("(?<!\\\\)\\.");
        ImmutableList.Builder<String> fields = ImmutableList.builder();
        for (String path : paths) {
            fields.add(path.replaceAll("\\\\\\.", ".").replaceAll("\\\\\\\\", "\\\\"));
        }
        return fields.build();
    }
private List < String > getFieldPath ( String field ) { String [ ] paths = field . split ( "(?<!\\\\)\\." ) ; ImmutableList . Builder < String > fields = ImmutableList . builder ( ) ; for ( String path : paths ) { fields . add ( path . replaceAll ( "\\\\\\." , "." ) . replaceAll ( "\\\\\\\\" , "\\\\" ) ) ; } return fields . build ( ) ; }
Converts a field to a list of segments.  For example, "source.country.lang" becomes ("source", "country", "lang").
Dots are escaped using "\." and slashes are escaped using "\\".