Class FieldCacheHandler

java.lang.Object
io.github.arasdenizhan.core.handler.FieldCacheHandler

public final class FieldCacheHandler extends Object
Utility class to efficiently store given class fields in a cache.

Instead of each time calling getDeclaredFields() on a class, this class first checks if the cache map has already fields for this class. If not, it gets all declared fields and put them to the cache. This avoids performance exhaustion while getting declared fields for a class.

  • Constructor Details

    • FieldCacheHandler

      public FieldCacheHandler()
  • Method Details

    • getFields

      public Field[] getFields(Class<?> clazz)