Class JdbiImmutables

    • Constructor Detail

      • JdbiImmutables

        public JdbiImmutables()
    • Method Detail

      • 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 <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 <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.