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

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

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