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

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

Introduction

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

Prototype

public static String repeat(String str, int repeat) 

Source Link

Document

Repeat a String repeat times to form a new String.

Usage

From source file:adalid.core.UIComponent.java

@Override
protected String fieldsToString(int n, String key, boolean verbose, boolean fields, boolean maps) {
    String tab = verbose ? StringUtils.repeat(" ", 4) : "";
    String fee = verbose ? StringUtils.repeat(tab, n) : "";
    String faa = " = ";
    String foo = verbose ? EOL : ", ";
    String string = super.fieldsToString(n, key, verbose, fields, maps);
    if (fields || verbose) {
        if (verbose) {
            string += fee + tab + "field" + faa + _field + foo;
        }//from ww  w .j  a  va2s  .c  o  m

    }
    return string;
}

From source file:com.incapture.slate.model.node.description.table.TableSeparatorNode.java

public TableSeparatorNode(TableHeaderNode tableHeaderNode) {
    separators = new ArrayList<>(tableHeaderNode.getFields().size());
    for (String field : tableHeaderNode.getFields()) {
        separators.add(StringUtils.repeat("-", field.length()));
    }/*from   w w  w  . j  a  v  a  2 s .  co m*/
}

From source file:com.incapture.slate.model.node.description.HeaderNode.java

@Override
public String getContent() {
    return StringUtils.repeat("#", level) + " " + content;
}

From source file:net.bible.service.format.osistohtml.taghandler.LHandler.java

public LHandler(OsisToHtmlParameters parameters, HtmlTextWriter writer) {
    this.parameters = parameters;
    this.writer = writer;
    int indentCharCount = parameters.getIndentDepth();
    indent_html = StringUtils.repeat(HTML.NBSP, indentCharCount);
}

From source file:adalid.core.KeyField.java

@Override
protected String fieldsToString(int n, String key, boolean verbose, boolean fields, boolean maps) {
    String tab = verbose ? StringUtils.repeat(" ", 4) : "";
    String fee = verbose ? StringUtils.repeat(tab, n) : "";
    String faa = " = ";
    String foo = verbose ? EOL : ", ";
    String string = super.fieldsToString(n, key, verbose, fields, maps);
    if (fields || verbose) {
        if (verbose) {
            String property = _property == null ? "" : _property.getName();
            string += fee + tab + "property" + faa + property + foo;
            string += fee + tab + "sortOption" + faa + _sortOption + foo;
        }/*from   w w  w  . ja v a 2s.  c om*/
    }
    return string;
}

From source file:com.github.capone.protocol.crypto.SigningKeyTest.java

@Test(expected = SigningKey.InvalidSeedException.class)
public void signingKeyFromSeedWithInvalidCharsThrows() throws SigningKey.InvalidSeedException {
    SigningKey.fromSeed(StringUtils.repeat("x", SigningKey.BYTES * 2));
}

From source file:ai.grakn.graql.internal.parser.SyntaxError.java

@Override
public String toString() {
    if (queryLine == null) {
        return ErrorMessage.SYNTAX_ERROR_NO_POINTER.getMessage(line, msg);
    } else {//from w  w w.j  a  v a  2  s.  c  o  m
        // Error message appearance:
        //
        // syntax error at line 1:
        // match $
        //       ^
        // blah blah antlr blah
        String pointer = StringUtils.repeat(" ", charPositionInLine) + "^";
        return ErrorMessage.SYNTAX_ERROR.getMessage(line, queryLine, pointer, msg);
    }
}

From source file:de.uniwue.info2.numerics.prec.SinglePrecisionFloat.java

@Override
protected String floatValueToBinaryString(String value) {
    float f = Float.parseFloat(value);
    String binary;// w w  w . ja  v a 2  s . c  om
    if (f == 0) {
        binary = StringUtils.repeat("0", 32);
    } else {
        binary = Integer.toBinaryString(Float.floatToIntBits(f));
    }
    return binary;
}

From source file:de.uniwue.info2.numerics.prec.DoublePrecisionFloat.java

@Override
protected String floatValueToBinaryString(String value) {
    double d = Double.parseDouble(value);
    String binary;/*from   w  w  w  . j  a  va  2 s. c  o m*/
    if (d == 0) {
        binary = StringUtils.repeat("0", 64);
    } else {
        binary = Long.toBinaryString(Double.doubleToLongBits(d));
    }
    return binary;
}

From source file:com.adobe.acs.commons.util.InfoWriter.java

/**
 * Creates the opening line with a Title.
 * @param title the title//from w w w.j  a  v  a  2 s  .c  o m
 */
public void title(String title) {
    pw.println();
    pw.println(StringUtils.repeat(LINE_CHAR, LINE_LENGTH));

    if (StringUtils.isNotBlank(title)) {
        pw.println(title);
        pw.println(StringUtils.repeat("=", LINE_LENGTH));
    }
}