// Path: src/main/java/me/welkinbai/bsonmapper/exception/BsonMapperConverterException.java
// public class BsonMapperConverterException extends RuntimeException {
// 
//     public BsonMapperConverterException() {
//         super();
//     }
// 
//     public BsonMapperConverterException(String message) {
//         super(message);
//     }
// 
//     public BsonMapperConverterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public BsonMapperConverterException(Throwable cause) {
//         super(cause);
//     }
// 
// }


import me.welkinbai.bsonmapper.annotations.BsonArrayField;
import me.welkinbai.bsonmapper.annotations.BsonField;
import me.welkinbai.bsonmapper.annotations.BsonIgnore;
import me.welkinbai.bsonmapper.exception.BsonMapperConverterException;
import org.bson.types.ObjectId;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static com.sun.javafx.fxml.BeanAdapter.IS_PREFIX;
        return IS_PREFIX + name.substring(0, 1).toUpperCase() + name.substring(1);
    }

    public static void checkNotNull(Object object, String message) {
        if (object == null) {
            throw new NullPointerException(message);
        }
    }

    public static List<Field> getAllField(Class<?> tClass) {
        Field[] tClassDeclaredFields = tClass.getDeclaredFields();
        List<Field> result = new ArrayList<Field>();
        result.addAll(Arrays.asList(tClassDeclaredFields));
        Class<?> superClass;
        while ((superClass = tClass.getSuperclass()) != null) {
            for (Field field : superClass.getDeclaredFields()) {
                int modifiers = field.getModifiers();
                if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
                    result.add(field);
                }
            }
            tClass = superClass;
        }
        return result;
    }

    public static <T> T newInstanceByClazz(Class<T> targetClazz) {
        try {
            return targetClazz.newInstance();
        } catch (InstantiationException e) {
// Path: src/main/java/me/welkinbai/bsonmapper/exception/BsonMapperConverterException.java
// public class BsonMapperConverterException extends RuntimeException {
// 
//     public BsonMapperConverterException() {
//         super();
//     }
// 
//     public BsonMapperConverterException(String message) {
//         super(message);
//     }
// 
//     public BsonMapperConverterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public BsonMapperConverterException(Throwable cause) {
//         super(cause);
//     }
// 
// }


// Path: src/main/java/me/welkinbai/bsonmapper/Utils.java
import me.welkinbai.bsonmapper.annotations.BsonArrayField;
import me.welkinbai.bsonmapper.annotations.BsonField;
import me.welkinbai.bsonmapper.annotations.BsonIgnore;
import me.welkinbai.bsonmapper.exception.BsonMapperConverterException;
import org.bson.types.ObjectId;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static com.sun.javafx.fxml.BeanAdapter.IS_PREFIX;

        return IS_PREFIX + name.substring(0, 1).toUpperCase() + name.substring(1);
    }

    public static void checkNotNull(Object object, String message) {
        if (object == null) {
            throw new NullPointerException(message);
        }
    }

    public static List<Field> getAllField(Class<?> tClass) {
        Field[] tClassDeclaredFields = tClass.getDeclaredFields();
        List<Field> result = new ArrayList<Field>();
        result.addAll(Arrays.asList(tClassDeclaredFields));
        Class<?> superClass;
        while ((superClass = tClass.getSuperclass()) != null) {
            for (Field field : superClass.getDeclaredFields()) {
                int modifiers = field.getModifiers();
                if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
                    result.add(field);
                }
            }
            tClass = superClass;
        }
        return result;
    }

    public static <T> T newInstanceByClazz(Class<T> targetClazz) {
        try {
            return targetClazz.newInstance();
        } catch (InstantiationException e) {
            throw new BsonMapperConverterException("should never happen.", e);