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

com.github.restup.bind.param.NoOpParameterProvider Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package com.github.restup.bind.param;

import java.util.Collections;
import java.util.List;

/**
 * Lazily initialized singleton {@link ParameterProvider} with no op implementations.
 */
public class NoOpParameterProvider implements ParameterProvider {

    private static volatile NoOpParameterProvider instance = null;

    private NoOpParameterProvider() {
        super();
    }

    public static NoOpParameterProvider getInstance() {
        if (instance == null) {
            synchronized (NoOpParameterProvider.class) {
                if (instance == null) {
                    instance = new NoOpParameterProvider();
                }
            }
        }
        return instance;
    }

    /**
     * @return empty, immutable list always, never null
     */
    @Override
    public List getParameterNames() {
        return Collections.emptyList();
    }

    /**
     * @return null always
     */
    @Override
    public String[] getParameter(String parameterName) {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy