class DimensionalObjectUtils {

    public static String getPrettyFilter( String filter )
    {
        if ( filter == null || !filter.contains( DIMENSION_NAME_SEP ) )
        {
            return null;
        }

        List<String> filterItems = new ArrayList<>();

        String[] split = filter.split( DIMENSION_NAME_SEP );

        for ( int i = 0; i < split.length; i += 2 )
        {
            QueryOperator operator = QueryOperator.fromString( split[i] );
            String value = split[i+1];

            if ( operator != null )
            {
                boolean ignoreOperator = ( QueryOperator.LIKE.equals( operator ) || QueryOperator.IN.equals( operator ) );

                value = value.replaceAll( QueryFilter.OPTION_SEP, TITLE_ITEM_SEP );

                filterItems.add( ( ignoreOperator ? StringUtils.EMPTY : ( operator.getValue() + " " ) ) + value );
            }
        }

        return StringUtils.join( filterItems, TITLE_ITEM_SEP );
    }

}