com.rojoma.json.v3.-impl.codec.TupleEncode.scala Maven / Gradle / Ivy
The newest version!
package com.rojoma.json.v3
package `-impl`.codec
import com.rojoma.json.v3.codec._
import com.rojoma.json.v3.ast.JArray
class TupleEncode {
implicit def tuple2Encode[A,B]( implicit cA: JsonEncode[A],cB: JsonEncode[B]) = new JsonEncode[(A,B)] {
def encode(tuple: (A,B)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2)))
}
}
implicit def tuple3Encode[A,B,C]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C]) = new JsonEncode[(A,B,C)] {
def encode(tuple: (A,B,C)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3)))
}
}
implicit def tuple4Encode[A,B,C,D]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D]) = new JsonEncode[(A,B,C,D)] {
def encode(tuple: (A,B,C,D)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4)))
}
}
implicit def tuple5Encode[A,B,C,D,E]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E]) = new JsonEncode[(A,B,C,D,E)] {
def encode(tuple: (A,B,C,D,E)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5)))
}
}
implicit def tuple6Encode[A,B,C,D,E,F]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F]) = new JsonEncode[(A,B,C,D,E,F)] {
def encode(tuple: (A,B,C,D,E,F)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6)))
}
}
implicit def tuple7Encode[A,B,C,D,E,F,G]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G]) = new JsonEncode[(A,B,C,D,E,F,G)] {
def encode(tuple: (A,B,C,D,E,F,G)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7)))
}
}
implicit def tuple8Encode[A,B,C,D,E,F,G,H]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H]) = new JsonEncode[(A,B,C,D,E,F,G,H)] {
def encode(tuple: (A,B,C,D,E,F,G,H)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8)))
}
}
implicit def tuple9Encode[A,B,C,D,E,F,G,H,I]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I]) = new JsonEncode[(A,B,C,D,E,F,G,H,I)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9)))
}
}
implicit def tuple10Encode[A,B,C,D,E,F,G,H,I,J]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10)))
}
}
implicit def tuple11Encode[A,B,C,D,E,F,G,H,I,J,K]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11)))
}
}
implicit def tuple12Encode[A,B,C,D,E,F,G,H,I,J,K,L]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12)))
}
}
implicit def tuple13Encode[A,B,C,D,E,F,G,H,I,J,K,L,M]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13)))
}
}
implicit def tuple14Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14)))
}
}
implicit def tuple15Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15)))
}
}
implicit def tuple16Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16)))
}
}
implicit def tuple17Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17)))
}
}
implicit def tuple18Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q],cR: JsonEncode[R]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17),cR.encode(tuple._18)))
}
}
implicit def tuple19Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q],cR: JsonEncode[R],cS: JsonEncode[S]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17),cR.encode(tuple._18),cS.encode(tuple._19)))
}
}
implicit def tuple20Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q],cR: JsonEncode[R],cS: JsonEncode[S],cT: JsonEncode[T]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17),cR.encode(tuple._18),cS.encode(tuple._19),cT.encode(tuple._20)))
}
}
implicit def tuple21Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q],cR: JsonEncode[R],cS: JsonEncode[S],cT: JsonEncode[T],cU: JsonEncode[U]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17),cR.encode(tuple._18),cS.encode(tuple._19),cT.encode(tuple._20),cU.encode(tuple._21)))
}
}
implicit def tuple22Encode[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V]( implicit cA: JsonEncode[A],cB: JsonEncode[B],cC: JsonEncode[C],cD: JsonEncode[D],cE: JsonEncode[E],cF: JsonEncode[F],cG: JsonEncode[G],cH: JsonEncode[H],cI: JsonEncode[I],cJ: JsonEncode[J],cK: JsonEncode[K],cL: JsonEncode[L],cM: JsonEncode[M],cN: JsonEncode[N],cO: JsonEncode[O],cP: JsonEncode[P],cQ: JsonEncode[Q],cR: JsonEncode[R],cS: JsonEncode[S],cT: JsonEncode[T],cU: JsonEncode[U],cV: JsonEncode[V]) = new JsonEncode[(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V)] {
def encode(tuple: (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V)): JArray = {
JArray(Seq(cA.encode(tuple._1),cB.encode(tuple._2),cC.encode(tuple._3),cD.encode(tuple._4),cE.encode(tuple._5),cF.encode(tuple._6),cG.encode(tuple._7),cH.encode(tuple._8),cI.encode(tuple._9),cJ.encode(tuple._10),cK.encode(tuple._11),cL.encode(tuple._12),cM.encode(tuple._13),cN.encode(tuple._14),cO.encode(tuple._15),cP.encode(tuple._16),cQ.encode(tuple._17),cR.encode(tuple._18),cS.encode(tuple._19),cT.encode(tuple._20),cU.encode(tuple._21),cV.encode(tuple._22)))
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy