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

com.google.inject.internal.ConstantFactory Maven / Gradle / Ivy

package com.google.inject.internal;

import com.google.common.base.MoreObjects;
import com.google.inject.spi.Dependency;

final class ConstantFactory implements InternalFactory {

    private final Initializable initializable;

    ConstantFactory(Initializable initializable) {
        this.initializable = initializable;
    }

    @Override
    public T get(InternalContext context, Dependency dependency, boolean linked)
            throws InternalProvisionException {
        return initializable.get();
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(ConstantFactory.class)
                .add("value", initializable)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy