Getting field name and values and storing it in a map
<p>This is my code for getting field values and annotation values, I placed the values into a map, however problem is there is a <code>$this</code> that is in the map.       </p>

<pre><code>Map doc = null;
        String kind = null;
        Class classObj = obj.getClass();
        Annotation[] annotations = classObj.getAnnotations();
        for (Annotation annotation : annotations) {
                Entity entityAnnotation = (Entity)annotation; 
                kind = entityAnnotation.name();
                if (entityAnnotation != null){
                        if (doc == null){
                            doc = new LinkedHashMap();
                        }
                        Field[] fields = classObj.getDeclaredFields();
                        for (Field field : fields){
                                annotations = field.getDeclaredAnnotations();
                                String value = null;
                                String fieldName = field.getName();
                                try {
                                        boolean access = field.isAccessible();
                                        field.setAccessible(true);
                                        Object fieldValue = field.get(obj); 
                                        doc.put(fieldName, fieldValue);
                                        field.setAccessible(access);
                                } catch (Exception e) {
                                        e.printStackTrace();
                                }                               
                                // Process fields with annotation
                                for(Annotation fieldAnnotation : annotations){
                                    if (annotation instanceof Id){
                                        Id idAnnotation = (Id) fieldAnnotation;
                                        log.info("Field name="+fieldName+" "+ value + " Annotation value: " + idAnnotation.value()); 
                                        doc.put("_id", value);
                                    }                                   
                                }
                        }                               
                }
        }
</code></pre>

<p>Test output:</p>

<pre><code>Key=id value=id1
Key=name value=Eli
Key=age value=25
Key=this$0 value=org.goo.AnnotationTest@7f5227
</code></pre>
