Class JdbiImmutables

java.lang.Object
org.jdbi.v3.core.mapper.immutables.JdbiImmutables
All Implemented Interfaces:
JdbiConfig<JdbiImmutables>

@Beta public class JdbiImmutables extends Object implements JdbiConfig<JdbiImmutables>
Configures support for an Immutables generated Immutable or Modifiable value type.
  • Constructor Details

    • JdbiImmutables

      public JdbiImmutables()
  • Method Details

    • setRegistry

      public void setRegistry(ConfigRegistry registry)
      Description copied from interface: JdbiConfig
      The registry will inject itself into the configuration object. This can be useful if you need to look up dependencies. You will get a new registry after being copied.
      Specified by:
      setRegistry in interface JdbiConfig<JdbiImmutables>
      Parameters:
      registry - the registry that owns this configuration object
    • registerImmutable

      public <S> JdbiImmutables registerImmutable(Class<S> spec)
      Register bean arguments and row mapping for an Immutable* value class, expecting the default generated class and builder names.
      Type Parameters:
      S - the specification class
      Parameters:
      spec - the specification interface or abstract class
      Returns:
      a plugin that configures type mapping for the given class
    • registerImmutable

      public JdbiImmutables registerImmutable(Class<?>... specs)
      Convenience method for registering many immutable types.
      See Also:
    • registerImmutable

      public JdbiImmutables registerImmutable(Iterable<Class<?>> specs)
      Convenience method for registering many immutable types.
      See Also:
    • registerImmutable

      public <S, I extends S> JdbiImmutables registerImmutable(Class<S> spec, Class<I> impl, Supplier<?> builder)
      Register bean arguments and row mapping for an Immutable* value class, using a supplied implementation and builder.
      Type Parameters:
      S - the specification class
      I - the implementation class
      Parameters:
      spec - the specification interface or abstract class
      impl - the generated implementation class
      builder - a supplier of new Builder instances
      Returns:
      a plugin that configures type mapping for the given class
    • registerModifiable

      public JdbiImmutables registerModifiable(Class<?>... specs)
      Convenience method for registering many modifiable types.
      See Also:
    • registerModifiable

      public JdbiImmutables registerModifiable(Iterable<Class<?>> specs)
      Convenience method for registering many modifiable types.
      See Also:
    • registerModifiable

      public <S> JdbiImmutables registerModifiable(Class<S> spec)
      Register bean arguments and row mapping for an Modifiable* value class, expecting the default generated class and public nullary constructor.
      Type Parameters:
      S - the specification class
      Parameters:
      spec - the specification interface or abstract class
      Returns:
      a plugin that configures type mapping for the given class
    • registerModifiable

      public <S, M extends S> JdbiImmutables registerModifiable(Class<S> spec, Class<M> impl, Supplier<?> constructor)
      Register bean arguments and row mapping for an Modifiable* value class, using a supplied implementation and constructor.
      Type Parameters:
      S - the specification class
      M - the modifiable class
      Parameters:
      spec - the specification interface or abstract class
      impl - the modifiable class
      constructor - a supplier of new Modifiable instances
      Returns:
      a plugin that configures type mapping for the given class
    • createCopy

      public JdbiImmutables createCopy()
      Description copied from interface: JdbiConfig
      Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.
      Specified by:
      createCopy in interface JdbiConfig<JdbiImmutables>
      Returns:
      a copy of this configuration object.