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

org.microbule.test.osgi.ServicePropsBuilder Maven / Gradle / Ivy

The newest version!
package org.microbule.test.osgi;

import java.util.Dictionary;
import java.util.Hashtable;

public class ServicePropsBuilder {
//----------------------------------------------------------------------------------------------------------------------
// Fields
//----------------------------------------------------------------------------------------------------------------------

    private final Dictionary props = new Hashtable<>();

//----------------------------------------------------------------------------------------------------------------------
// Static Methods
//----------------------------------------------------------------------------------------------------------------------

    public static ServicePropsBuilder props() {
        return new ServicePropsBuilder();
    }

//----------------------------------------------------------------------------------------------------------------------
// Other Methods
//----------------------------------------------------------------------------------------------------------------------

    public Dictionary build() {
        return props;
    }

    public ServicePropsBuilder with(String name, Object value) {
        if (value == null) {
            props.remove(name);
        } else {
            props.put(name, value);
        }
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy