
org.ioc.commons.utils.format.HasLabelStringFormatter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-ext Show documentation
Show all versions of ioc-commons-ext Show documentation
Library which contains some extension classes for the library IOC-Commons.
It provides some interface definitions and some tool classes which are non-dependent from the used technology;
i.e. the classes and interfaces from this library do not depend on the choosen ioc-commons-implementation library.
The newest version!
package org.ioc.commons.utils.format;
import org.ioc.commons.domain.features.HasLabel;
import org.ioc.commons.utils.Format.StringFormatter;
public class HasLabelStringFormatter implements StringFormatter {
private boolean nullAsEmptyString = false;
@Override
public String asString(T obj) {
String label = obj != null ? obj.getLabel() : null;
return label != null ? label : (this.nullAsEmptyString ? "" : null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy