// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyTypes.java
// public abstract class MetaTinyTypes {
// 
//     public static final MetaTinyType[] metas = new MetaTinyType[]{
//         new StringTinyTypes(),
//         new BooleanTinyTypes(),
//         new ByteTinyTypes(),
//         new ShortTinyTypes(),
//         new IntTinyTypes(),
//         new LongTinyTypes()
//     };
// 
//     /**
//      * Provides a type-specific Meta class for the given TinyType.
//      *
//      * @param <T> the TinyType class type
//      * @param candidate the TinyType class to obtain a Meta for
//      * @return a Meta implementation suitable for the candidate
//      * @throws IllegalArgumentException for null or a non-TinyType
//      */
//     public static <T> MetaTinyType<T> metaFor(Class<?> candidate) {
//         for (MetaTinyType meta : metas) {
//             if (meta.isMetaOf(candidate)) {
//                 return meta;
//             }
//         }
//         throw new IllegalArgumentException(String.format("not a tinytype: %s", candidate == null ? "null" : candidate.getCanonicalName()));
//     }
// 
//     /**
//      * Checks whether a class is a TinyType. A class is considered a TinyType if
//      * is a direct ancestor of a tech.anima.tinytypes.*TinyType, is not abstract
//      * and provides a ctor matching super.
//      *
//      * @param candidate the class to be checked
//      * @return true if the candidate is a TinyType, false otherwise.
//      */
//     public static boolean isTinyType(Class<?> candidate) {
//         for (MetaTinyType meta : metas) {
//             if (meta.isMetaOf(candidate)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }


import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.deser.KeyDeserializers;
import java.io.IOException;
import tech.anima.tinytypes.meta.MetaTinyTypes;
package tech.anima.tinytypes.jackson;


public class TinyTypesKeyDeserializers implements KeyDeserializers {

    @Override
    public KeyDeserializer findKeyDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException {
        final Class<?> candidateTT = type.getRawClass();
        if (MetaTinyTypes.isTinyType(candidateTT)) {
            return new TinyTypesKeyDeserializer(candidateTT);
        }

        return null;
    }

    public static class TinyTypesKeyDeserializer extends KeyDeserializer {

        private final Class<?> type;

        public TinyTypesKeyDeserializer(Class<?> type) {
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyTypes.java
// public abstract class MetaTinyTypes {
// 
//     public static final MetaTinyType[] metas = new MetaTinyType[]{
//         new StringTinyTypes(),
//         new BooleanTinyTypes(),
//         new ByteTinyTypes(),
//         new ShortTinyTypes(),
//         new IntTinyTypes(),
//         new LongTinyTypes()
//     };
// 
//     /**
//      * Provides a type-specific Meta class for the given TinyType.
//      *
//      * @param <T> the TinyType class type
//      * @param candidate the TinyType class to obtain a Meta for
//      * @return a Meta implementation suitable for the candidate
//      * @throws IllegalArgumentException for null or a non-TinyType
//      */
//     public static <T> MetaTinyType<T> metaFor(Class<?> candidate) {
//         for (MetaTinyType meta : metas) {
//             if (meta.isMetaOf(candidate)) {
//                 return meta;
//             }
//         }
//         throw new IllegalArgumentException(String.format("not a tinytype: %s", candidate == null ? "null" : candidate.getCanonicalName()));
//     }
// 
//     /**
//      * Checks whether a class is a TinyType. A class is considered a TinyType if
//      * is a direct ancestor of a tech.anima.tinytypes.*TinyType, is not abstract
//      * and provides a ctor matching super.
//      *
//      * @param candidate the class to be checked
//      * @return true if the candidate is a TinyType, false otherwise.
//      */
//     public static boolean isTinyType(Class<?> candidate) {
//         for (MetaTinyType meta : metas) {
//             if (meta.isMetaOf(candidate)) {
//                 return true;
//             }
//         }
//         return false;
//     }
// 
// }


// Path: jackson/src/main/java/tech/anima/tinytypes/jackson/TinyTypesKeyDeserializers.java
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.deser.KeyDeserializers;
import java.io.IOException;
import tech.anima.tinytypes.meta.MetaTinyTypes;

package tech.anima.tinytypes.jackson;


public class TinyTypesKeyDeserializers implements KeyDeserializers {

    @Override
    public KeyDeserializer findKeyDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException {
        final Class<?> candidateTT = type.getRawClass();
        if (MetaTinyTypes.isTinyType(candidateTT)) {
            return new TinyTypesKeyDeserializer(candidateTT);
        }

        return null;
    }

    public static class TinyTypesKeyDeserializer extends KeyDeserializer {

        private final Class<?> type;

        public TinyTypesKeyDeserializer(Class<?> type) {
            if (type == null || !MetaTinyTypes.isTinyType(type)) {