Example usage for com.google.common.base Strings nullToEmpty

List of usage examples for com.google.common.base Strings nullToEmpty

Introduction

In this page you can find the example usage for com.google.common.base Strings nullToEmpty.

Prototype

public static String nullToEmpty(@Nullable String string) 

Source Link

Document

Returns the given string if it is non-null; the empty string otherwise.

Usage

From source file:br.edu.utfpr.cm.JGitMinerWeb.services.matriz.auxiliary.AuxMentionsPerIssue.java

public void setNumberOfMentions() {

    this.numberIssue += MentionsValidator.mentionInString(Strings.nullToEmpty(this.body));

    for (EntityComment entityComment : commentsList) {
        this.numberOfMentions += MentionsValidator
                .mentionInString(Strings.nullToEmpty(entityComment.getBody()));

    }//  w w  w . j  a  v a2s. c  o  m
}

From source file:ec.tss.TsIdentifier.java

public TsIdentifier(@Nullable String name, @Nonnull TsMoniker moniker) {
    this.name = Strings.nullToEmpty(name);
    this.moniker = moniker;
}

From source file:diskCacheV111.srm.UserNameJobDiscriminator.java

@Nonnull
@Override
protected String getDiscriminatingValue(SRMUser user) {
    return Strings.nullToEmpty(Subjects.getUserName(((DcacheUser) user).getSubject()));
}

From source file:pzalejko.iot.hardware.home.core.service.configuration.DefaultSenderSettings.java

public DefaultSenderSettings(Properties properties) {
    checkNotNull(properties);//from  w w w .j  av a2 s. c  o  m
    senderHost = Strings.nullToEmpty(properties.getProperty(SENDER_HOST_KEY));
    senderClientId = Strings.nullToEmpty(properties.getProperty(SENDER_CLIENT_ID_KEY));

    checkArgument(!senderHost.isEmpty());
    checkArgument(!senderClientId.isEmpty());
}

From source file:diskCacheV111.srm.DistinguishedNameJobDiscriminator.java

@Nonnull
@Override
protected String getDiscriminatingValue(SRMUser user) {
    return Strings.nullToEmpty(Subjects.getDn(((DcacheUser) user).getSubject()));
}

From source file:com.google.devtools.cyclefinder.CycleFinder.java

private static JdtParser createParser(Options options) {
    JdtParser parser = new JdtParser();
    parser.addSourcepathEntries(Strings.nullToEmpty(options.getSourcepath()));
    parser.addClasspathEntries(Strings.nullToEmpty(options.getBootclasspath()));
    parser.addClasspathEntries(Strings.nullToEmpty(options.getClasspath()));
    parser.setEncoding(options.fileEncoding());
    return parser;
}

From source file:com.gwtplatform.dispatch.rest.rebind.type.ResourceBinding.java

public ResourceBinding(String resourcePath, String implPackage, String implName) {
    this.resourcePath = Strings.nullToEmpty(resourcePath);
    this.implName = implName;
    this.implPackage = implPackage;
}

From source file:io.github.valters.xsdiff.report.NodeToString.java

/** remove all possible (invisible) whitespace: including line breaks. used to see if document is actually empty and alternative printer should be used. */
public String trim(final String str) {
    return CharMatcher.invisible().trimFrom(Strings.nullToEmpty(str));
}

From source file:com.google.collide.client.code.debugging.Breakpoint.java

private Breakpoint(Builder builder) {
    this.path = builder.path;
    this.lineNumber = builder.lineNumber;
    this.condition = Strings.nullToEmpty(builder.condition);
    this.active = builder.active;
}

From source file:org.n52.shetland.ogc.ows.OwsValuesReference.java

public OwsValuesReference(URI reference, String value) {
    this.reference = Objects.requireNonNull(reference);
    this.value = Strings.nullToEmpty(value);
}