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

com.servicerocket.confluence.randombits.support.core.env.AbstractEnvironmentProvider Maven / Gradle / Ivy

There is a newer version: 2.5.12
Show newest version
package com.servicerocket.confluence.randombits.support.core.env;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * A base implementation for {@link EnvironmentProvider} instances.
 */
public abstract class AbstractEnvironmentProvider implements EnvironmentProvider {

    private final Set> supportedTypes;

    private int weight;

    public AbstractEnvironmentProvider( Class... supportedTypes ) {
        this.supportedTypes = Collections.unmodifiableSet( new HashSet>( Arrays.asList( supportedTypes ) ) );
    }

    public void setWeight( int weight ) {
        this.weight = weight;
    }

    @Override
    public int getWeight() {
        return weight;
    }

    @Override
    public Set> getSupportedTypes() {
        return supportedTypes;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy