Example usage for org.apache.commons.lang3 StringUtils rightPad

List of usage examples for org.apache.commons.lang3 StringUtils rightPad

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils rightPad.

Prototype

public static String rightPad(final String str, final int size, String padStr) 

Source Link

Document

Right pad a String with a specified String.

The String is padded to the size of size .

 StringUtils.rightPad(null, *, *)      = null StringUtils.rightPad("", 3, "z")      = "zzz" StringUtils.rightPad("bat", 3, "yz")  = "bat" StringUtils.rightPad("bat", 5, "yz")  = "batyz" StringUtils.rightPad("bat", 8, "yz")  = "batyzyzy" StringUtils.rightPad("bat", 1, "yz")  = "bat" StringUtils.rightPad("bat", -1, "yz") = "bat" StringUtils.rightPad("bat", 5, null)  = "bat  " StringUtils.rightPad("bat", 5, "")    = "bat  " 

Usage

From source file:modelos.CustomListModelLibros.java

@Override
public Object getElementAt(int index) {
    Libros p = lista.get(index);/*w ww  .  j a v a 2 s .  c  o  m*/
    return "Isbn :" + StringUtils.leftPad(String.valueOf(p.getIsbn()), 15, '0') + "     Titulo: "
            + StringUtils.rightPad(p.getTitulo(), 50, ' ') + "     Autor: "
            + StringUtils.rightPad(p.getAutor(), 30, ' ') + "     Categorias: "
            + StringUtils.rightPad(p.getCategorias(), 30, ' ');
}

From source file:modelos.CustomListModelCopias.java

@Override
public Object getElementAt(int index) {
    Copias p = lista.get(index);/*from w w  w.  j  a  v a  2s.co m*/
    return "Cdigo copia: " + StringUtils.leftPad(String.valueOf(p.getNumeroSerie()), 13, '0') + "  Titulo: "
            + StringUtils.rightPad(p.getTitulo(), 50, ' ');
}

From source file:ec.edu.distri.clientejava.protocolo.model.Usuario.java

public void setContrasena(String contrasena) {
    this.contrasena = StringUtils.rightPad(contrasena, 16, " ");
}

From source file:ec.edu.distri.clientejava.protocolo.model.Canal.java

public void setNombre(String nombre) {
    this.nombre = StringUtils.rightPad(nombre, 25, " ");
}

From source file:ec.edu.distri.clientejava.protocolo.model.Cliente.java

public void setApellido(String apellido) {
    this.apellido = StringUtils.rightPad(apellido, 25, " ");
}

From source file:kenh.expl.functions.RightPad.java

public String process(String str, int size, String padStr) {
    return StringUtils.rightPad(str, size, padStr);
}

From source file:ec.edu.distri.clientejava.protocolo.model.Canal.java

public void setDescripcion(String descripcion) {
    this.descripcion = StringUtils.rightPad(descripcion, 100, " ");
}

From source file:ec.edu.distri.clientejava.protocolo.model.Cliente.java

public void setCedula(String cedula) {
    this.cedula = StringUtils.rightPad(cedula, 10, " ");
}

From source file:com.daraf.projectdarafprotocol.clienteapp.seguridades.AutenticacionEmpresaRQ.java

public void setUserId(String userId) {
    this.userId = StringUtils.rightPad(userId, 20, " ");
}

From source file:com.daraf.projectdarafprotocol.appdb.seguridades.AutenticacionEmpresaRS.java

@Override
public void build(String input) {
    if (validate(input)) {
        if (input.length() < maxLength) {
            input = StringUtils.rightPad(input, maxLength, " ");
        }// www.ja v  a 2s .  c  o  m
        try {
            String values[] = MyStringUtil.splitByFixedLengths(input, new int[] { 1, 400 });
            this.resultado = values[0];
            if (this.resultado.equals("1")) {
                String empresaValues[] = StringUtils.splitPreserveAllTokens(values[1],
                        Cuerpo.FIELD_SEPARATOR_CHAR);
                this.empresa = new Empresa();
                this.empresa.setRuc(empresaValues[0]);
                this.empresa.setNombre(empresaValues[1]);
                this.empresa.setTelefono(empresaValues[2]);
                this.empresa.setDireccion(empresaValues[3]);
                this.empresa.setUsuario(empresaValues[4]);
                this.empresa.setPassword(empresaValues[5]);
            }
        } catch (Exception ex) {
            Logger.getLogger(AutenticacionEmpresaRS.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}