Here you can find the source of addFieldClass(String fieldName, Class clazz)
public static boolean addFieldClass(String fieldName, Class clazz)
//package com.java2s; //License from project: MIT License import java.util.HashMap; import java.util.Map; public class Main { private static Map<String, Class> fieldTypeMap = new HashMap<>(); public static boolean addFieldClass(String fieldName, Class clazz) { if (fieldTypeMap.containsKey(fieldName) && fieldTypeMap.get(fieldName) != clazz) { System.out.println("Field type inconsistancy '" + fieldName + "' with types : " + fieldTypeMap.get(fieldName) + " and " + clazz); return false; }/*from w w w . j ava2 s . com*/ fieldTypeMap.put(fieldName, clazz); return true; } }