Skip to content

Commit

Permalink
More 2.12
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Gee <[email protected]> 🫥
  • Loading branch information
JosBogan committed Jul 10, 2024
1 parent 548d06d commit e123926
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,20 @@ class Fs2RabbitAmqpClient[F[_]: Async](

override def declare(declarations: Iterable[decl.Declaration]): F[Unit] = {
def argumentsFromAnyRef(arguments: Map[String, AnyRef]): Map[String, SafeArg] =
arguments.view
.mapValues[SafeArg] {
case arg: String => arg
case arg: BigDecimal => arg
case arg: Integer => arg.intValue()
case arg: java.lang.Long => arg.longValue()
case arg: java.lang.Double => arg.doubleValue()
case arg: java.lang.Float => arg.floatValue()
case arg: java.lang.Short => arg.shortValue()
case arg: java.lang.Boolean => arg.booleanValue()
case arg: java.lang.Byte => arg.byteValue()
case arg: java.util.Date => arg
case t => throw new IllegalArgumentException(s"Unsupported type for rabbit arguments $t")
arguments
.map[String, SafeArg] {
case (k, arg: String) => k -> arg
case (k, arg: BigDecimal) => k -> arg
case (k, arg: Integer) => k -> arg.intValue()
case (k, arg: java.lang.Long) => k -> arg.longValue()
case (k, arg: java.lang.Double) => k -> arg.doubleValue()
case (k, arg: java.lang.Float) => k -> arg.floatValue()
case (k, arg: java.lang.Short) => k -> arg.shortValue()
case (k, arg: java.lang.Boolean) => k -> arg.booleanValue()
case (k, arg: java.lang.Byte) => k -> arg.byteValue()
case (k, arg: java.util.Date) => k -> arg
case t => throw new IllegalArgumentException(s"Unsupported type for rabbit arguments $t")
}
.toMap

def exchangeTypeToFs2ExchangeType(exchangeType: ExchangeType): model.ExchangeType =
exchangeType match {
Expand Down

0 comments on commit e123926

Please sign in to comment.