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

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

Introduction

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

Prototype

public static String trimToNull(final String str) 

Source Link

Document

Removes control characters (char <= 32) from both ends of this String returning null if the String is empty ("") after the trim or if it is null .

Usage

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture5(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_5_FILE, file);
    this.set(FIELD_PICTURE_5_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_5_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_5_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture6(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_6_FILE, file);
    this.set(FIELD_PICTURE_6_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_6_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_6_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture7(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_7_FILE, file);
    this.set(FIELD_PICTURE_7_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_7_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_7_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture8(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_8_FILE, file);
    this.set(FIELD_PICTURE_8_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_8_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_8_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture9(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_9_FILE, file);
    this.set(FIELD_PICTURE_9_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_9_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_9_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture10(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_10_FILE, file);
    this.set(FIELD_PICTURE_10_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_10_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_10_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture11(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_11_FILE, file);
    this.set(FIELD_PICTURE_11_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_11_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_11_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture12(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_12_FILE, file);
    this.set(FIELD_PICTURE_12_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_12_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_12_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.IdxRecord.java

public void setPicture13(Media value) {
    String file = (value != null) ? StringUtils.trimToNull(value.getFileName()) : null;
    this.set(FIELD_PICTURE_13_FILE, file);
    this.set(FIELD_PICTURE_13_TITLE,
            (value != null && file != null) ? IdxFormat.printString(value.getTitle(), 200) : null);
    this.set(FIELD_PICTURE_13_TEXT,
            (value != null && file != null) ? IdxFormat.printString(value.getDescription(), 1800) : null);
    this.set(FIELD_PICTURE_13_URL, (value != null && file != null) ? value.getUrl() : null);
}

From source file:org.openestate.io.idx.types.GrossPremium.java

public static GrossPremium parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (GrossPremium g : GrossPremium.values()) {
        if (g.value.equalsIgnoreCase(value))
            return g;
    }/*from  w  w w  .  j  av  a  2  s  .c  o  m*/
    return null;
}