All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.hamnaberg.json.codec.Codecs Maven / Gradle / Ivy

The newest version!
package net.hamnaberg.json.codec;

import net.hamnaberg.arities.*;
import net.hamnaberg.json.Json;

import java.net.URI;
import java.net.URL;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.function.Function;

public abstract class Codecs {
    private Codecs(){}

    public static final JsonCodec CIdentity = new DefaultJsonCodec<>(
            Decoders.DIdentity,
            Encoders.EIdentity,
            "Identity"
    );

    public static final JsonCodec CString = new DefaultJsonCodec<>(
            Decoders.DString,
            Encoders.EString,
            "String"
    );

    public static final JsonCodec CNumber = new DefaultJsonCodec<>(
            Decoders.DNumber,
            Encoders.ENumber,
            "Number"
    );

    public static final JsonCodec CLong = new DefaultJsonCodec<>(
            Decoders.DLong,
            Encoders.ELong,
            "Long"
    );

    public static final JsonCodec CDouble = new DefaultJsonCodec<>(
            Decoders.DDouble,
            Encoders.EDouble,
            "Double"
    );

    public static final JsonCodec CInt = new DefaultJsonCodec<>(
            Decoders.DInt,
            Encoders.EInt,
            "Int"
    );

    public static final JsonCodec CBoolean = new DefaultJsonCodec<>(
            Decoders.DBoolean,
            Encoders.EBoolean,
            "Boolean"
    );

    public static final JsonCodec CURI = new DefaultJsonCodec<>(
            Decoders.DURI,
            Encoders.EURI,
            "URI"
    );

    public static final JsonCodec CURL = new DefaultJsonCodec<>(
            Decoders.DURL,
            Encoders.EURL,
            "URL"
    );
    public static final JsonCodec CUUID = new DefaultJsonCodec<>(
            Decoders.DUUID,
            Encoders.EUUID,
            "UUID"
    );

    public static final JsonCodec CISODateTimeUTC = new DefaultJsonCodec<>(
            Decoders.DISODateTimeUTC,
            Encoders.EISODateTimeUTC,
            "ZonedDateTime"
    );

    public static final JsonCodec CISOInstantUTC = new DefaultJsonCodec<>(
            Decoders.DISOInstantUTC,
            Encoders.EISOInstantUTC,
            "Instant"
    );

    public static  JsonCodec nullCodec() {
        return new DefaultJsonCodec<>(
                ignore -> DecodeResult.ok(null),
                ignore -> Json.jNull(),
                "Null"
        );
    }

    public static  JsonCodec> listCodec(JsonCodec codec) {
        return new DefaultJsonCodec<>(
                Decoders.listDecoder(codec),
                Encoders.listEncoder(codec),
                String.format("List(%s)", codec.toString())
        );
    }

    public static  JsonCodec> setCodec(JsonCodec codec) {
        return new DefaultJsonCodec<>(
                Decoders.setDecoder(codec),
                Encoders.setEncoder(codec),
                String.format("Set(%s)", codec.toString())
        );
    }

    public static  JsonCodec> optionalCodec(JsonCodec codec) {
        return new DefaultJsonCodec<>(
                Decoders.optionalDecoder(codec),
                Encoders.optionalencoder(codec),
                String.format("Optional(%s)", codec.toString())
        );
    }

    public static  JsonCodec objectCodec(Function> decoder, Function encoder) {
        return JsonCodec.lift(
                json -> decoder.apply(json.asJsonObjectOrEmpty()),
                a ->encoder.apply(a).asJValue()
        );
    }

    public static  JsonCodec of(NamedJsonCodec c1) {
        return codec(c1);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2) {
        return codec(Iso.identity(), c1, c2);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3) {
        return codec(Iso.identity(), c1, c2, c3);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4) {
        return codec(Iso.identity(), c1, c2, c3, c4);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7);
    }

    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25, NamedJsonCodec c26) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26);
    }


    public static  JsonCodec> of(NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25, NamedJsonCodec c26, NamedJsonCodec c27) {
        return codec(Iso.identity(), c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27);
    }

    public static  JsonCodec codec(NamedJsonCodec c1) {
        return new JsonCodec() {
            @Override
            public Json.JValue toJson(TT value) {
                return Json.jObject(
                        c1.name,
                        c1.toJson(value)
                ).asJValue();
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                Json.JObject object = value.asJsonObjectOrEmpty();

                return DecodeResult.decode(object, c1.name, c1);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());

                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        Tuple2::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        Tuple3::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        Tuple4::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        Tuple5::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        Tuple6::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        Tuple7::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        Tuple8::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        Tuple9::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        Tuple10::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        Tuple11::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        Tuple12::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        Tuple13::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        Tuple14::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        Tuple15::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        Tuple16::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        Tuple17::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        Tuple18::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        Tuple19::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        Tuple20::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        Tuple21::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        Tuple22::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder(),
                        c23.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        c23.toFieldDecoder(),
                        Tuple23::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                map.put(c23.name, c23.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder(),
                        c23.toFieldEncoder(),
                        c24.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        c23.toFieldDecoder(),
                        c24.toFieldDecoder(),
                        Tuple24::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                map.put(c23.name, c23.codec.toString());
                map.put(c24.name, c24.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder(),
                        c23.toFieldEncoder(),
                        c24.toFieldEncoder(),
                        c25.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        c23.toFieldDecoder(),
                        c24.toFieldDecoder(),
                        c25.toFieldDecoder(),
                        Tuple25::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                map.put(c23.name, c23.codec.toString());
                map.put(c24.name, c24.codec.toString());
                map.put(c25.name, c25.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25, NamedJsonCodec c26) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder(),
                        c23.toFieldEncoder(),
                        c24.toFieldEncoder(),
                        c25.toFieldEncoder(),
                        c26.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        c23.toFieldDecoder(),
                        c24.toFieldDecoder(),
                        c25.toFieldDecoder(),
                        c26.toFieldDecoder(),
                        Tuple26::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                map.put(c23.name, c23.codec.toString());
                map.put(c24.name, c24.codec.toString());
                map.put(c25.name, c25.codec.toString());
                map.put(c26.name, c26.codec.toString());
                return "codec" + map.toString();
            }
        };
    }


    public static  JsonCodec codec(Iso> iso, NamedJsonCodec c1, NamedJsonCodec c2, NamedJsonCodec c3, NamedJsonCodec c4, NamedJsonCodec c5, NamedJsonCodec c6, NamedJsonCodec c7, NamedJsonCodec c8, NamedJsonCodec c9, NamedJsonCodec c10, NamedJsonCodec c11, NamedJsonCodec c12, NamedJsonCodec c13, NamedJsonCodec c14, NamedJsonCodec c15, NamedJsonCodec c16, NamedJsonCodec c17, NamedJsonCodec c18, NamedJsonCodec c19, NamedJsonCodec c20, NamedJsonCodec c21, NamedJsonCodec c22, NamedJsonCodec c23, NamedJsonCodec c24, NamedJsonCodec c25, NamedJsonCodec c26, NamedJsonCodec c27) {
        return new JsonCodec() {

            @Override
            public Json.JValue toJson(TT value) {
                return Encoders.encode(
                        c1.toFieldEncoder(),
                        c2.toFieldEncoder(),
                        c3.toFieldEncoder(),
                        c4.toFieldEncoder(),
                        c5.toFieldEncoder(),
                        c6.toFieldEncoder(),
                        c7.toFieldEncoder(),
                        c8.toFieldEncoder(),
                        c9.toFieldEncoder(),
                        c10.toFieldEncoder(),
                        c11.toFieldEncoder(),
                        c12.toFieldEncoder(),
                        c13.toFieldEncoder(),
                        c14.toFieldEncoder(),
                        c15.toFieldEncoder(),
                        c16.toFieldEncoder(),
                        c17.toFieldEncoder(),
                        c18.toFieldEncoder(),
                        c19.toFieldEncoder(),
                        c20.toFieldEncoder(),
                        c21.toFieldEncoder(),
                        c22.toFieldEncoder(),
                        c23.toFieldEncoder(),
                        c24.toFieldEncoder(),
                        c25.toFieldEncoder(),
                        c26.toFieldEncoder(),
                        c27.toFieldEncoder()
                ).toJson(iso.get(value));
            }

            @Override
            public DecodeResult fromJson(Json.JValue value) {
                return Decoders.decode(
                        c1.toFieldDecoder(),
                        c2.toFieldDecoder(),
                        c3.toFieldDecoder(),
                        c4.toFieldDecoder(),
                        c5.toFieldDecoder(),
                        c6.toFieldDecoder(),
                        c7.toFieldDecoder(),
                        c8.toFieldDecoder(),
                        c9.toFieldDecoder(),
                        c10.toFieldDecoder(),
                        c11.toFieldDecoder(),
                        c12.toFieldDecoder(),
                        c13.toFieldDecoder(),
                        c14.toFieldDecoder(),
                        c15.toFieldDecoder(),
                        c16.toFieldDecoder(),
                        c17.toFieldDecoder(),
                        c18.toFieldDecoder(),
                        c19.toFieldDecoder(),
                        c20.toFieldDecoder(),
                        c21.toFieldDecoder(),
                        c22.toFieldDecoder(),
                        c23.toFieldDecoder(),
                        c24.toFieldDecoder(),
                        c25.toFieldDecoder(),
                        c26.toFieldDecoder(),
                        c27.toFieldDecoder(),
                        Tuple27::new
                ).fromJson(value).map(iso::reverseGet);
            }

            @Override
            public String toString() {
                Map map = new HashMap<>();
                map.put(c1.name, c1.codec.toString());
                map.put(c2.name, c2.codec.toString());
                map.put(c3.name, c3.codec.toString());
                map.put(c4.name, c4.codec.toString());
                map.put(c5.name, c5.codec.toString());
                map.put(c6.name, c6.codec.toString());
                map.put(c7.name, c7.codec.toString());
                map.put(c8.name, c8.codec.toString());
                map.put(c9.name, c9.codec.toString());
                map.put(c10.name, c10.codec.toString());
                map.put(c11.name, c11.codec.toString());
                map.put(c12.name, c12.codec.toString());
                map.put(c13.name, c13.codec.toString());
                map.put(c14.name, c14.codec.toString());
                map.put(c15.name, c15.codec.toString());
                map.put(c16.name, c16.codec.toString());
                map.put(c17.name, c17.codec.toString());
                map.put(c18.name, c18.codec.toString());
                map.put(c19.name, c19.codec.toString());
                map.put(c20.name, c20.codec.toString());
                map.put(c21.name, c21.codec.toString());
                map.put(c22.name, c22.codec.toString());
                map.put(c23.name, c23.codec.toString());
                map.put(c24.name, c24.codec.toString());
                map.put(c25.name, c25.codec.toString());
                map.put(c26.name, c26.codec.toString());
                map.put(c27.name, c27.codec.toString());
                return "codec" + map.toString();
            }
        };
    }
}