Object

com.netflix.atlas.core.util

Strings

Related Doc: package util

Permalink

object Strings

Helper functions for working with strings.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Strings
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def cast[T](c: Class[_], v: String): T

    Permalink

    Cast a string value to an internal type.

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  7. def conversionExists(c: Class[_]): Boolean

    Permalink

    Returns true if a conversion exists for the specified class.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def extractReferencePointDate(str: String): Option[String]

    Permalink

    Returns the name of the reference point for relative dates.

    Returns the name of the reference point for relative dates. For example, with the relative date now-5m, it would return now.

  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  13. def hexDecode(input: String, escapeChar: Char = '%'): String

    Permalink

    Hex decode an input string.

    Hex decode an input string.

    input

    Input string to decode.

    escapeChar

    Character used to indicate the start of a hex encoded symbol.

    returns

    Decoded string.

  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def isRelativeDate(str: String, customRef: Boolean): Boolean

    Permalink

    Returns true if a date string is relative.

    Returns true if a date string is relative. If custom ref is true it will check if it is a relative date against a custom reference point other than now or the epoch.

  16. def isRelativeDate(str: String): Boolean

    Permalink

    Returns true if a date string is relative.

  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  20. def parseColor(str: String): Color

    Permalink

    Parse a color expressed as a hexadecimal RRGGBB string.

  21. def parseDate(ref: ZonedDateTime, str: String, tz: ZoneId): ZonedDateTime

    Permalink

    Return the time associated with a given string.

    Return the time associated with a given string.

    - now, n: - start, s: - end, e: - epoch:

    - seconds, s: - minutes, m: - hours, h: - days, d: - weeks, w: - months - years, y:

  22. def parseDate(str: String, tz: ZoneId = ZoneOffset.UTC): ZonedDateTime

    Permalink

    Return the time associated with a given string.

    Return the time associated with a given string. The time will be relative to now.

  23. def parseDuration(str: String): Duration

    Permalink

    Parse a string that follows the ISO8601 spec or at time range spec into a period object.

  24. def parseQueryString(query: String): Map[String, List[String]]

    Permalink

    Returns a map corresponding to the URL query parameters in the string.

  25. def stripMargin(str: String): String

    Permalink

    Strip the margin from multi-line strings.

  26. def substitute(str: String, vars: (String) ⇒ String): String

    Permalink

    Substitute variables into a string.

  27. def substitute(str: String, vars: Map[String, String]): String

    Permalink

    Substitute variables from the map into a string.

    Substitute variables from the map into a string. If a key used in the input string is not set, then the key will be used as the value.

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. def timeRange(s: String, e: String, tz: ZoneId = ZoneOffset.UTC): (Instant, Instant)

    Permalink

    Parse start and end time strings that can be relative to each other and resolve to precise instants.

    Parse start and end time strings that can be relative to each other and resolve to precise instants.

    s

    Start time string in a format supported by parseDate.

    e

    End time string in a format supported by parseDate.

    tz

    Time zone to assume for the times if a zone is not explicitly specified. Defaults to UTC.

    returns

    Tuple start -> end.

  30. def toString(d: Duration): String

    Permalink

    Returns a string representation of a period.

  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. def urlDecode(s: String): String

    Permalink

    Lenient url-decoder.

    Lenient url-decoder. The URLDecoder class provided in the jdk throws if there is an invalid hex encoded value. This function will map invalid encodes to a %25 (a literal percent sign) and then decode it normally.

  33. def urlEncode(s: String): String

    Permalink

    Lenient url-encoder.

    Lenient url-encoder. The URLEncoder class provided in the jdk is eager to percent encode making atlas expressions hard to read. This version assumes the only escaping necessary for '%', '&', '+', '?', '=', and ' '.

  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. def zeroPad(v: Array[Byte], width: Int): String

    Permalink

    Convert integer represented as a byte array to a hex string and zero pad.

    Convert integer represented as a byte array to a hex string and zero pad. This can be used to avoid a conversion to BigInteger if the hex string is the only result needed. The minimum padding width is 2, smaller values will get ignored.

  38. def zeroPad(v: BigInteger, width: Int): String

    Permalink

    Convert BigInteger value to hex string and zero pad.

  39. def zeroPad(v: Long, width: Int): String

    Permalink

    Convert long value to hex string and zero pad.

    Convert long value to hex string and zero pad. It is intended for positive values and the integer value will be treated as unsigned.

  40. def zeroPad(v: Int, width: Int): String

    Permalink

    Convert integer value to hex string and zero pad.

    Convert integer value to hex string and zero pad. It is intended for positive values and the integer value will be treated as unsigned.

  41. def zeroPad(s: String, width: Int): String

    Permalink

    Left pad the input string with zeros to the specified width.

    Left pad the input string with zeros to the specified width. This is typically used as an alternative to performing zero padding using String.format.

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped