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

com.sdklite.net.AbstractUriHandler Maven / Gradle / Ivy

The newest version!
package com.sdklite.net;

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

/**
 * The abstraction of {@link UriHandler}
 * 
 * @author johnsonlee
 *
 */
public abstract class AbstractUriHandler implements UriHandler {

    private final Set schemes;
    
    public AbstractUriHandler(final String... schemes) {
        final Set set = new TreeSet(String.CASE_INSENSITIVE_ORDER);
        set.addAll(Arrays.asList(schemes));
        this.schemes = Collections.unmodifiableSet(set);
    }

    @Override
    public Set getSupportedSchemes() {
        return this.schemes;
    }

    @Override
    public boolean isSchemeSupported(final String scheme) {
        return this.schemes.contains(scheme);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy