summaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/main/scala/com/yahoo/container/plugin/util/Strings.scala
blob: 5f854fda9443d1947545a2880bb5a97fde967bc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.plugin.util

 /**
 * @author  tonytv
 */
object Strings {
  def emptyStringTo(replacement: String)(s: String) = {
    if (s.isEmpty) replacement
    else s
  }

  def noneIfEmpty(s: String) = Option(s).filterNot(_.isEmpty)
}