Packages

p

com.twitter

conversions

package conversions

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract class SeqUtilCompanion extends AnyRef

Value Members

  1. object DurationOps

    Implicits for writing readable com.twitter.util.Durations.

    Implicits for writing readable com.twitter.util.Durations.

    Example:
    1. import com.twitter.conversions.DurationOps._
      
      2000.nanoseconds
      50.milliseconds
      1.second
      24.hours
      40.days
  2. object MapOps

    Implicits for converting Maps.

    Implicits for converting Maps.

    Example:
    1. import com.twitter.conversions.MapOps._
      
      Map(1 -> "a").mapKeys { _.toString }
      Map(1 -> "a").invert
      Map(1 -> "a", 2 -> "b").filterValues { _ == "b" }
      Map(2 -> "b", 1 -> "a").toSortedMap
  3. object PercentOps

    Implicits for turning x.percent (where x is an Int or Double) into a Double scaled to where 1.0 is 100 percent.

    Implicits for turning x.percent (where x is an Int or Double) into a Double scaled to where 1.0 is 100 percent.

    Example:
    1. import com.twitter.conversions.PercentOps._
      
      1.percent == 0.01
      100.percent == 1.0
      99.9.percent == 0.999
      500.percent == 5.0
      -10.percent == -0.1
    Note

    Negative values, fractional values, and values greater than 100 are permitted.

  4. object SeqOps

    Implicits for converting Seqs.

    Implicits for converting Seqs.

    Example:
    1. import com.twitter.conversions.SeqOps._
      
      Seq("a", "and").createMap(_.size, _)
      Seq("a", "and").groupBySingleValue(_.size)
      Seq("a", "and").findItemAfter("a")
      
      var numStrings = 0
      Seq(1, 2) foreachPartial {
        case e: Int =>
          numStrings += 1
      }
  5. object SeqUtil
  6. object StorageUnitOps

    Implicits for writing readable com.twitter.util.StorageUnits.

    Implicits for writing readable com.twitter.util.StorageUnits.

    Example:
    1. import com.twitter.conversions.StorageUnitOps._
      
      5.bytes
      1.kilobyte
      256.gigabytes
  7. object StringOps
  8. object ThreadOps

    Implicits for turning a block of code into a Runnable or Callable.

  9. object TupleOps

    Implicits for converting tuples.

    Implicits for converting tuples.

    Example:
    1. import com.twitter.conversions.TupleOps._
      
      Seq(1 -> "tada", 2 -> "lala").toKeys
      Seq(1 -> "tada", 2 -> "lala").mapValues(_.size)
      Seq(1 -> "tada", 2 -> "lala").groupByKeyAndReduce(_ + "," + _)
      Seq(1 -> "tada", 2 -> "lala").sortByKey
  10. object U64Ops

Ungrouped