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.is24_csv.Is24CsvRecord.java

public void setObjektdarstellungGruppen(String[] value) {
    this.set(FIELD_OBJEKTDARSTELLUNG_GRUPPEN, StringUtils.trimToNull(StringUtils.join(value, ";")));
}

From source file:org.openestate.io.is24_csv.types.Ausstattung.java

public static Ausstattung parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (Ausstattung s : Ausstattung.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }/*  w  ww . j  a  v a 2s.co m*/
    return KEINE_ANGABE;
}

From source file:org.openestate.io.is24_csv.types.Auswahl.java

public static Auswahl parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (Auswahl s : Auswahl.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }/*  w  w  w .  j ava2  s . c om*/
    return null;
}

From source file:org.openestate.io.is24_csv.types.Bauphase.java

public static Bauphase parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (Bauphase s : Bauphase.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }// ww w  .  ja va 2s .  c om
    return KEINE_ANGABE;
}

From source file:org.openestate.io.is24_csv.types.BebaubarNach.java

public static BebaubarNach parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (BebaubarNach s : BebaubarNach.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }/*from   ww w .java  2 s . c  o  m*/
    return UNBEKANNT;
}

From source file:org.openestate.io.is24_csv.types.Befeuerungsart.java

public static Befeuerungsart parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (Befeuerungsart s : Befeuerungsart.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }/*from www .j a va 2  s .c  om*/
    return KEINE_ANGABE;
}

From source file:org.openestate.io.is24_csv.types.Befeuerungsart.java

public static String printMultiple(Iterable<Befeuerungsart> arten) {
    if (arten == null)
        return null;
    List<String> values = new ArrayList<String>();
    for (Befeuerungsart art : arten) {
        if (Befeuerungsart.KEINE_ANGABE.equals(art))
            continue;
        String value = art.print();
        if (!values.contains(value))
            values.add(value);/*from   w w  w.j a v  a 2 s . c  o m*/
    }
    return StringUtils.trimToNull(StringUtils.join(values, ";"));
}

From source file:org.openestate.io.is24_csv.types.Bodenbelag.java

public static Bodenbelag parse(String value) {
    value = StringUtils.trimToNull(value);
    if (value == null)
        return null;
    for (Bodenbelag s : Bodenbelag.values()) {
        if (String.valueOf(s.value).equalsIgnoreCase(value))
            return s;
    }//w  ww . ja  v a2  s .c  o m
    return KEINE_ANGABE;
}

From source file:org.openestate.io.is24_csv.types.DateiSuffix.java

public static DateiSuffix fromFileName(String fileName) {
    fileName = StringUtils.lowerCase(StringUtils.trimToNull(fileName));
    if (fileName != null) {
        for (DateiSuffix s : DateiSuffix.values()) {
            if (fileName.endsWith(s.name().toLowerCase())) {
                return s;
            }/*from w ww.  j  a v a  2s.  co  m*/
        }
    }
    return null;
}

From source file:org.openestate.io.is24_csv.types.DateiSuffix.java

public static DateiSuffix fromMimeType(String mimeType) {
    mimeType = StringUtils.lowerCase(StringUtils.trimToNull(mimeType));

    if ("video/x-msvideo".equals(mimeType))
        return AVI;

    else if ("image/bmp".equals(mimeType))
        return BMP;

    else if ("image/gif".equals(mimeType))
        return GIF;

    else if ("image/jpeg".equals(mimeType))
        return JPG;

    else if ("video/quicktime".equals(mimeType))
        return MOV;

    else if ("video/mp4".equals(mimeType))
        return MP4;

    //else if ("video/mpeg".equals( mimeType ))
    //  return MPE;

    else if ("video/mpeg".equals(mimeType))
        return MPEG;

    //else if ("video/mpeg".equals( mimeType ))
    //  return MPG;

    else if ("application/pdf".equals(mimeType))
        return PDF;

    else if ("image/png".equals(mimeType))
        return PNG;

    else if ("video/quicktime".equals(mimeType))
        return QT;

    //else if ("video/quicktime".equals( mimeType ))
    //  return QTL;

    else if ("application/vnd.rn-realmedia".equals(mimeType))
        return RM;

    else if ("video/vnd.rn-realvideo".equals(mimeType))
        return RV;

    else if ("video/x-ms-wmv".equals(mimeType))
        return WMV;

    else/*from   ww  w  . ja  v  a  2 s .c  o m*/
        return null;
}