/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arrebol.taxiservicios.utils;

/**
 *
 * @author Picasso
 */
public class FolioUtility {

    /**
     * Build the folio numeration, eg <br>folio = 1<br>prefix SO-<br>suffix
     * -2019<br>length 6<br>character 0<br>Builder folio = SO-000001-2019.
     *
     * @param folio Current folio number
     * @param prefix Prefix of the folio include separator eg. prefix "SO",
     * separator "-", complete prefix "SO-".
     * @param suffix Suffix of the folio include separator eg. suufix "2019",
     * separator "-", complete prefix "-2019".
     * @param length Length of the numeric folio number.
     * @param character Character to add in folio.
     *
     * @return Folio builded.
     */
    public static String buildFolio(String folio, String prefix, String suffix, int length, String character) {
        StringBuilder builder = new StringBuilder(prefix);

        for (int i = folio.length(); i < length; i++) {
            builder.append(character);
        }
        builder.append(folio);
        builder.append(suffix);

        return builder.toString();
    }
}
