All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bootique.linkmove.LinkMoveModuleExtender Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package io.bootique.linkmove;

import com.google.inject.Binder;
import com.google.inject.multibindings.Multibinder;
import io.bootique.ModuleExtender;

/**
 * @since 0.14
 */
public class LinkMoveModuleExtender extends ModuleExtender {

    private Multibinder buildCallback;

    public LinkMoveModuleExtender(Binder binder) {
        super(binder);
    }

    @Override
    public LinkMoveModuleExtender initAllExtensions() {
        contributeBuildCallback();
        return this;
    }

    public LinkMoveModuleExtender addLinkMoveBuilderCallback(LinkMoveBuilderCallback callback) {
        contributeBuildCallback().addBinding().toInstance(callback);
        return this;
    }

    public LinkMoveModuleExtender addLinkMoveBuilderCallback(Class callbackType) {
        contributeBuildCallback().addBinding().to(callbackType);
        return this;
    }

    protected Multibinder contributeBuildCallback() {
        return buildCallback != null ? buildCallback  : (buildCallback = newSet(LinkMoveBuilderCallback.class));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy