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

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

Introduction

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

Prototype

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

Source Link

Document

Right pad a String with a specified String.

Usage

From source file:org.jumpmind.metl.core.runtime.component.ModelAttributeScriptHelper.java

public String rpad(String padChar, int length) {
    String text = value != null ? value.toString() : "";
    return StringUtils.rightPad(text, length, padChar);
}

From source file:org.jumpmind.symmetric.test.SimpleIntegrationTest.java

@Test(timeout = 120000)
public void test10LargeLob() {
    if (!isServerOracle()) {
        return;// ww w.  j a  v a  2s. co m
    }
    String bigString = StringUtils.rightPad("Feeling tired... ", 6000, "Z");
    Customer customer = new Customer(400, "Eric", true, "100 Main Street", "Columbus", "OH", 43082, new Date(),
            new Date(), bigString, bigString.getBytes());
    serverTestService.insertCustomer(customer);
    clientPull();
}

From source file:org.kuali.kfs.gl.batch.ScrubberSortComparator.java

public int compare(String string1, String string2) {
    string1 = StringUtils.rightPad(string1, originEntryRecordLength, ' ');
    string2 = StringUtils.rightPad(string2, originEntryRecordLength, ' ');

    StringBuilder sb1 = new StringBuilder();
    sb1.append(string1.substring(compareRanges[0].start, compareRanges[0].end));
    sb1.append(string1.substring(compareRanges[1].start, compareRanges[1].end));
    sb1.append(string1.substring(compareRanges[2].start, compareRanges[2].end));
    sb1.append(string1.substring(compareRanges[3].start, compareRanges[3].end));
    sb1.append(string1.substring(compareRanges[4].start, compareRanges[4].end));
    sb1.append(string1.substring(compareRanges[5].start, compareRanges[5].end));

    StringBuilder sb2 = new StringBuilder();
    sb2.append(string2.substring(compareRanges[0].start, compareRanges[0].end));
    sb2.append(string2.substring(compareRanges[1].start, compareRanges[1].end));
    sb2.append(string2.substring(compareRanges[2].start, compareRanges[2].end));
    sb2.append(string2.substring(compareRanges[3].start, compareRanges[3].end));
    sb2.append(string2.substring(compareRanges[4].start, compareRanges[4].end));
    sb2.append(string2.substring(compareRanges[5].start, compareRanges[5].end));

    return sb1.toString().compareTo(sb2.toString());
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceUniversityFiscalPeriodCode() {
    if (SPACE_UNIVERSITY_FISCAL_PERIOD_CODE == null) {
        SPACE_UNIVERSITY_FISCAL_PERIOD_CODE = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, KFSPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE),
                        ' ');
    }//from ww  w . jav  a  2  s  .  c om
    return SPACE_UNIVERSITY_FISCAL_PERIOD_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceBalanceTypeCode() {
    if (SPACE_BALANCE_TYPE_CODE == null) {
        SPACE_BALANCE_TYPE_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(BalanceType.class, KFSPropertyConstants.CODE), ' ');
    }//  w  ww . j  av a  2s  . com
    return SPACE_BALANCE_TYPE_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceFinancialSystemOriginationCode() {
    if (SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE == null) {
        SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginationCode.class, KFSPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE),
                        ' ');
    }/*from  w w  w. j  av  a  2 s  . c  o m*/
    return SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceDebitCreditCode() {
    if (SPACE_DEBIT_CREDIT_CODE == null) {
        SPACE_DEBIT_CREDIT_CODE = StringUtils
                .rightPad("",
                        SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(
                                OriginEntryFull.class, KFSPropertyConstants.TRANSACTION_DEBIT_CREDIT_CODE),
                        ' ');
    }//from  w ww  .  ja v  a  2  s.  c om
    return SPACE_DEBIT_CREDIT_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceFinancialObjectCode() {
    if (SPACE_FINANCIAL_OBJECT_CODE == null) {
        SPACE_FINANCIAL_OBJECT_CODE = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(ObjectCode.class,
                        KFSPropertyConstants.FINANCIAL_OBJECT_CODE),
                ' ');
    }//from   w  ww .  j a  v  a 2s  .co m
    return SPACE_FINANCIAL_OBJECT_CODE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceTransactionDate() {
    if (SPACE_TRANSACTION_DATE == null) {
        SPACE_TRANSACTION_DATE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class)
                .getAttributeMaxLength(OriginEntryFull.class, KFSPropertyConstants.TRANSACTION_DATE), ' ');
    }/*  w  w w .  j  a v  a2s.c o  m*/
    return SPACE_TRANSACTION_DATE;
}

From source file:org.kuali.kfs.gl.GeneralLedgerConstants.java

public static String getSpaceUniversityFiscalYear() {
    if (SPACE_UNIVERSITY_FISCAL_YEAR == null) {
        SPACE_UNIVERSITY_FISCAL_YEAR = StringUtils.rightPad("",
                SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class,
                        KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR),
                ' ');
    }//from w w  w . j  a va 2s .co m
    return SPACE_UNIVERSITY_FISCAL_YEAR;
}