Example usage for org.apache.commons.text WordUtils wrap

List of usage examples for org.apache.commons.text WordUtils wrap

Introduction

In this page you can find the example usage for org.apache.commons.text WordUtils wrap.

Prototype

public static String wrap(final String str, final int wrapLength, final String newLineStr,
        final boolean wrapLongWords) 

Source Link

Document

Wraps a single line of text, identifying words by ' '.

Leading spaces on a new line are stripped.

Usage

From source file:io.github.seiferma.jameica.hibiscus.dkb.creditcard.synchronize.DKBScraperSynchronizeJobKontoauszugImpl.java

private Umsatz createTransaction(DKBTransaction transaction, Konto k) throws RemoteException {
    Umsatz hbciTransaction = Settings.getDBService().createObject(Umsatz.class, null);
    hbciTransaction.setKonto(k);//from ww  w . j ava2 s. com
    hbciTransaction.setDatum(transaction.getBookingDate());
    hbciTransaction.setValuta(transaction.getValueDate());
    hbciTransaction.setBetrag(transaction.getAmountInCents() / 100.0);
    hbciTransaction.setWeitereVerwendungszwecke(
            WordUtils.wrap(transaction.getDescription(), 35, "\n", true).split("\n"));
    if (!transaction.isBooked()) {
        int flags = hbciTransaction.getFlags() | Umsatz.FLAG_NOTBOOKED;
        hbciTransaction.setFlags(flags);
    }
    return hbciTransaction;
}