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

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

Introduction

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

Prototype

public static String stripToNull(String str) 

Source Link

Document

Strips whitespace from the start and end of a String returning null if the String is empty ("") after the strip.

This is similar to #trimToNull(String) but removes whitespace.

Usage

From source file:org.apache.samza.system.eventhub.descriptors.EventHubsOutputDescriptor.java

/**
 * SAS Token of the associated output stream. Required to access the output Event Hubs per stream.
 *
 * @param sasToken the SAS token required to access to Event Hubs entity
 * @return this output descriptor/*from w w  w.j av  a  2s .  c om*/
 */
public EventHubsOutputDescriptor<StreamMessageType> withSasKey(String sasToken) {
    this.sasToken = Optional.ofNullable(StringUtils.stripToNull(sasToken));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * In an HdfsWriter implementation that performs time-based output bucketing,
 * the user may configure a date format (suitable for inclusion in a file path)
 * using <code>SimpleDateFormat</code> formatting that the Bucketer implementation will
 * use to generate HDFS paths and filenames. The more granular this date format, the more
 * often a bucketing HdfsWriter will begin a new date-path bucket when creating the next output file.
 * @param datePathFormat date path format
 * @return this system descriptor/*  w w  w. jav a2s . com*/
 */
public HdfsSystemDescriptor withDatePathFormat(String datePathFormat) {
    this.datePathFormat = Optional.ofNullable(StringUtils.stripToNull(datePathFormat));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * The base output directory into which all HDFS output for this job will be written.
 * @param outputBaseDir output base directory
 * @return this system descriptor//from  www .  j a  v a  2  s . c  om
 */
public HdfsSystemDescriptor withOutputBaseDir(String outputBaseDir) {
    this.outputBaseDir = Optional.ofNullable(StringUtils.stripToNull(outputBaseDir));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * Simple, human-readable label for various compression options. HdfsWriter implementations
 * can choose how to handle these individually, or throw an exception. Example: "none", "gzip", ...
 * @param writeCompressionType compression type for writer.
 * @return this system descriptor/*from   w w  w . ja v a  2 s.com*/
 */
public HdfsSystemDescriptor withWriteCompressionType(String writeCompressionType) {
    this.writeCompressionType = Optional.ofNullable(StringUtils.stripToNull(writeCompressionType));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * The fully-qualified class name of the HdfsWriter subclass that will write for this system.
 * @param writerClassName writer class name.
 * @return this system descriptor/*  w  ww .j  av a  2s  .  co m*/
 */
public HdfsSystemDescriptor withWriterClassName(String writerClassName) {
    this.writerClass = Optional.ofNullable(StringUtils.stripToNull(writerClassName));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * White list used by directory partitioner to filter out unwanted files in a hdfs directory.
 * @param whiteList white list for HDFS consumer inputs.
 * @return this system descriptor//from ww w .  j  a  v a2  s.  com
 */
public HdfsSystemDescriptor withConsumerWhiteList(String whiteList) {
    this.consumerWhiteList = Optional.ofNullable(StringUtils.stripToNull(whiteList));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * Black list used by directory partitioner to filter out unwanted files in a hdfs directory.
 * @param blackList black list for HDFS consumer inputs.
 * @return this system descriptor/*from   ww w .j a v  a  2  s.  c o  m*/
 */
public HdfsSystemDescriptor withConsumerBlackList(String blackList) {
    this.consumerBlackList = Optional.ofNullable(StringUtils.stripToNull(blackList));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * Group pattern used by directory partitioner for advanced partitioning.
 * @param groupPattern group parttern for HDFS consumer inputs.
 * @return this system descriptor/*from w  ww .  j a  v  a  2s .c om*/
 */
public HdfsSystemDescriptor withConsumerGroupPattern(String groupPattern) {
    this.consumerGroupPattern = Optional.ofNullable(StringUtils.stripToNull(groupPattern));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * The type of the file reader for consumer (avro, plain, etc.)
 * @param readerType reader type for HDFS consumer inputs.
 * @return this system descriptor//from w  ww .j ava 2 s. c  om
 */
public HdfsSystemDescriptor withReaderType(String readerType) {
    this.consumerReader = Optional.ofNullable(StringUtils.stripToNull(readerType));
    return this;
}

From source file:org.apache.samza.system.hdfs.descriptors.HdfsSystemDescriptor.java

/**
 * Staging directory for storing partition description. If not set, will use the staging directory set
 * by yarn job./*w  w  w.  j  ava 2 s  .  c o  m*/
 * @param stagingDirectory staging directory for HDFS consumer inputs.
 * @return this system descriptor
 */
public HdfsSystemDescriptor withStagingDirectory(String stagingDirectory) {
    this.consumerStagingDirectory = Optional.ofNullable(StringUtils.stripToNull(stagingDirectory));
    return this;
}