Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
encrywm.backend.Compare.scala Maven / Gradle / Ivy
package encrywm.backend
import encrywm.backend.env.ESObject
import encrywm.backend.executor.error.UnsupportedOperationError
object Compare {
def eq(op1: Any, op2: Any): Boolean = {
(op1, op2) match {
case (o1: Int, o2: Int) => o1 == o2
case (o1: Int, o2: Long) => o1 == o2
case (o1: Int, o2: Float) => o1 == o2
case (o1: Int, o2: Double) => o1 == o2
case (o1: Long, o2: Int) => o1 == o2
case (o1: Long, o2: Long) => o1 == o2
case (o1: Long, o2: Float) => o1 == o2
case (o1: Long, o2: Double) => o1 == o2
case (o1: Float, o2: Int) => o1 == o2
case (o1: Float, o2: Long) => o1 == o2
case (o1: Float, o2: Float) => o1 == o2
case (o1: Float, o2: Double) => o1 == o2
case (o1: Double, o2: Int) => o1 == o2
case (o1: Double, o2: Long) => o1 == o2
case (o1: Double, o2: Float) => o1 == o2
case (o1: Double, o2: Double) => o1 == o2
case (o1: Boolean, o2: Boolean) => o1 == o2
case (o1: Array[Byte], o2: Array[Byte]) => o1 sameElements o2
case (o1: ESObject, o2: ESObject) => o1 == o2
case _ => throw UnsupportedOperationError
}
}
def gt(op1: Any, op2: Any): Boolean = {
(op1, op2) match {
case (o1: Int, o2: Int) => o1 > o2
case (o1: Int, o2: Long) => o1 > o2
case (o1: Int, o2: Float) => o1 > o2
case (o1: Int, o2: Double) => o1 > o2
case (o1: Long, o2: Int) => o1 > o2
case (o1: Long, o2: Long) => o1 > o2
case (o1: Long, o2: Float) => o1 > o2
case (o1: Long, o2: Double) => o1 > o2
case (o1: Float, o2: Int) => o1 > o2
case (o1: Float, o2: Long) => o1 > o2
case (o1: Float, o2: Float) => o1 > o2
case (o1: Float, o2: Double) => o1 > o2
case (o1: Double, o2: Int) => o1 > o2
case (o1: Double, o2: Long) => o1 > o2
case (o1: Double, o2: Float) => o1 > o2
case (o1: Double, o2: Double) => o1 > o2
case _ => throw UnsupportedOperationError
}
}
def gte(op1: Any, op2: Any): Boolean = {
(op1, op2) match {
case (o1: Int, o2: Int) => o1 >= o2
case (o1: Int, o2: Long) => o1 >= o2
case (o1: Int, o2: Float) => o1 >= o2
case (o1: Int, o2: Double) => o1 >= o2
case (o1: Long, o2: Int) => o1 >= o2
case (o1: Long, o2: Long) => o1 >= o2
case (o1: Long, o2: Float) => o1 >= o2
case (o1: Long, o2: Double) => o1 >= o2
case (o1: Float, o2: Int) => o1 >= o2
case (o1: Float, o2: Long) => o1 >= o2
case (o1: Float, o2: Float) => o1 >= o2
case (o1: Float, o2: Double) => o1 >= o2
case (o1: Double, o2: Int) => o1 >= o2
case (o1: Double, o2: Long) => o1 >= o2
case (o1: Double, o2: Float) => o1 >= o2
case (o1: Double, o2: Double) => o1 >= o2
case _ => throw UnsupportedOperationError
}
}
def lt(op1: Any, op2: Any): Boolean = {
(op1, op2) match {
case (o1: Int, o2: Int) => o1 < o2
case (o1: Int, o2: Long) => o1 < o2
case (o1: Int, o2: Float) => o1 < o2
case (o1: Int, o2: Double) => o1 < o2
case (o1: Long, o2: Int) => o1 < o2
case (o1: Long, o2: Long) => o1 < o2
case (o1: Long, o2: Float) => o1 < o2
case (o1: Long, o2: Double) => o1 < o2
case (o1: Float, o2: Int) => o1 < o2
case (o1: Float, o2: Long) => o1 < o2
case (o1: Float, o2: Float) => o1 < o2
case (o1: Float, o2: Double) => o1 < o2
case (o1: Double, o2: Int) => o1 < o2
case (o1: Double, o2: Long) => o1 < o2
case (o1: Double, o2: Float) => o1 < o2
case (o1: Double, o2: Double) => o1 < o2
case _ => throw UnsupportedOperationError
}
}
def lte(op1: Any, op2: Any): Boolean = {
(op1, op2) match {
case (o1: Int, o2: Int) => o1 <= o2
case (o1: Int, o2: Long) => o1 <= o2
case (o1: Int, o2: Float) => o1 <= o2
case (o1: Int, o2: Double) => o1 <= o2
case (o1: Long, o2: Int) => o1 <= o2
case (o1: Long, o2: Long) => o1 <= o2
case (o1: Long, o2: Float) => o1 <= o2
case (o1: Long, o2: Double) => o1 <= o2
case (o1: Float, o2: Int) => o1 <= o2
case (o1: Float, o2: Long) => o1 <= o2
case (o1: Float, o2: Float) => o1 <= o2
case (o1: Float, o2: Double) => o1 <= o2
case (o1: Double, o2: Int) => o1 <= o2
case (o1: Double, o2: Long) => o1 <= o2
case (o1: Double, o2: Float) => o1 <= o2
case (o1: Double, o2: Double) => o1 <= o2
case _ => throw UnsupportedOperationError
}
}
}