mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 22:58:54 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
23 lines
465 B
Scala
23 lines
465 B
Scala
package com.twitter.simclusters_v2.score
|
|
|
|
import com.twitter.simclusters_v2.thriftscala.{Score => ThriftScore}
|
|
|
|
/**
|
|
* A uniform value type for all kinds of Calculation Score.
|
|
**/
|
|
case class Score(score: Double) {
|
|
|
|
implicit lazy val toThrift: ThriftScore = {
|
|
ThriftScore(score)
|
|
}
|
|
}
|
|
|
|
object Score {
|
|
|
|
/**
|
|
* Only support Double Type Thrift score
|
|
*/
|
|
implicit val fromThriftScore: ThriftScore => Score = { thriftScore => Score(thriftScore.score) }
|
|
|
|
}
|