DEV Community

loading...
Cover image for How to get field values with Reflection and with direct memory access in Java

How to get field values with Reflection and with direct memory access in Java

Burningwave
Burningwave is a set consisting of a Java frameworks building library and other applications and frameworks based on it
Updated on ・1 min read

To get field values from an object in Java we are going to use Fields component. To start we need to add the following dependency to our pom.xml:


Fields component uses to cache all fields for faster access and in this code snippet we show how to handle the fields of any Java object even of anonymous type:

In this short article we have learned how to get fields of Java objects and how to handle them and the complete source is available at this link.

Discussion (0)