Class TypeAdapterLookupDelegate

java.lang.Object
org.neo4j.ogm.driver.TypeAdapterLookupDelegate

public final class TypeAdapterLookupDelegate extends Object
To be used by a driver to lookup type adapters, both native to mapped and mapped to native. This lookup wraps all returned adapters to make resilient against null values.
Author:
Michael J. Simons
  • Constructor Details

    • TypeAdapterLookupDelegate

      public TypeAdapterLookupDelegate(Map<Class<?>,Function> registeredTypeAdapter)
  • Method Details

    • getAdapterFor

      public Function<Object,Object> getAdapterFor(Class<?> clazz)
      Retrieves an adapter for the specified class. Can be either native or mapped class.
      Parameters:
      clazz - The class for which an adapter is needed.
      Returns:
      An adapter to convert an object of clazz to native or mapped, identity function if there's no adapter
    • hasAdapterFor

      public boolean hasAdapterFor(Class<?> clazz)