Example usage for java.util LinkedHashSet LinkedHashSet

List of usage examples for java.util LinkedHashSet LinkedHashSet

Introduction

In this page you can find the example usage for java.util LinkedHashSet LinkedHashSet.

Prototype

public LinkedHashSet(Collection<? extends E> c) 

Source Link

Document

Constructs a new linked hash set with the same elements as the specified collection.

Usage

From source file:org.siddhiesb.transport.http.conn.ProxyConfig.java

public ProxyConfig(final HttpHost proxy, final UsernamePasswordCredentials creds, final String[] proxyBypass) {
    super();/*from   w  w w . j  a  va 2 s. c  o  m*/
    this.proxy = proxy;
    this.creds = creds;
    if (proxyBypass != null) {
        this.proxyBypass = new LinkedHashSet<String>(proxyBypass.length);
        for (String s : proxyBypass) {
            this.proxyBypass.add(s.trim().toLowerCase(Locale.US));
        }
    } else {
        this.proxyBypass = Collections.<String>emptySet();
    }
}

From source file:hu.petabyte.redflags.engine.util.MappingUtils.java

public static void normalizeMapKeys(Map<String, String> map) {
    Set<String> keys = new LinkedHashSet<String>(map.keySet());
    for (String key : keys) {
        String value = map.get(key);
        map.remove(key);//  www . java 2  s. c  o m
        key = key.replaceAll("0", ".");
        map.put(key, value);
    }
}

From source file:org.juiser.spring.boot.config.ForwardedUserFilterConfig.java

public ForwardedUserFilterConfig() {
    this.enabled = true;
    this.matchAfter = false;
    this.order = 10;
    this.dispatcherTypes = new LinkedHashSet<>(Arrays.asList(DispatcherType.values()));
    this.requestAttributeNames = new LinkedHashSet<>(Collections.singletonList("user"));
    this.servletNames = new LinkedHashSet<>();
    this.urlPatterns = new LinkedHashSet<>(Collections.singletonList(DEFAULT_URL_PATTERN));
}

From source file:dtv.tools.DuplicateRemover.java

@Override
protected Task<List<DVBChannel>> createTask() {

    return new Task<List<DVBChannel>>() {
        @Override//from   www  .  j  a  v  a 2  s . c om
        protected List<DVBChannel> call() throws Exception {
            Set<DVBChannel> serviceSet = new LinkedHashSet<DVBChannel>(services);
            updateProgress(-1, 0);

            services.setAll(serviceSet);
            Utils.initIds(services);

            return services;
        }
    };
}

From source file:com.icfcc.cache.interceptor.CacheOperation.java

public void setCacheNames(String[] cacheNames) {
    Assert.notEmpty(cacheNames);/*w w  w .  j a va2  s .com*/
    this.cacheNames = new LinkedHashSet<String>(cacheNames.length);
    for (String string : cacheNames) {
        this.cacheNames.add(string);
    }
}

From source file:Main.java

/**
 * Copies a {@link Collection} into a new {@link LinkedHashSet}.
 * //  ww  w  .  j a  v a  2s  .  co m
 * @param original Collection to be copied. Cannot be {@code null}.
 * 
 * @return A new {@code LinkedHashSet} whose contents are the same as 
 * {@code original}.
 */
public static <E> Set<E> newLinkedHashSet(Collection<E> original) {
    return new LinkedHashSet<>(original);
}

From source file:com.yahoo.bard.webservice.druid.model.aggregation.CardinalityAggregation.java

/**
 * Constructor.//  w ww.  j a v  a  2  s .  c  om
 *
 * @param name  Name of the field
 * @param dimensions  The dimensions whose cardinality you want to capture
 * @param byRow  Whether to use Row or Value cardinality
 */
public CardinalityAggregation(String name, Set<Dimension> dimensions, boolean byRow) {
    super(name, "");
    this.dimensions = Collections.unmodifiableSet(new LinkedHashSet<>(dimensions));
    this.byRow = byRow;
}

From source file:com.asual.summer.core.spring.ConversionDiscoveryFactoryBean.java

@SuppressWarnings("rawtypes")
public ConversionService getObject() {
    ConversionService conversionService = super.getObject();
    if (conversionService instanceof ConverterRegistry) {
        ConverterRegistry registry = (ConverterRegistry) conversionService;
        if (cachedConverters == null) {
            cachedConverters = BeanUtils.getBeansOfType(Converter.class);
            ConversionServiceFactory.registerConverters(new LinkedHashSet<Converter>(cachedConverters.values()),
                    registry);/*from  w  w w .j  a  v a2 s.  c  o m*/
        }
    }
    return conversionService;
}

From source file:com.net2plan.utils.CollectionUtils.java

/**
 * Checks whether all elements of a collection are present in another one.
 *
 * @param <A> Key type// w  w  w. java  2  s.  c  om
 * @param container Container collection
 * @param collection Collection with elements to be checked
 * @return {@code true} if all elements in {@code collection} are present in {@code container}, and {@code false} otherwise. If {@code container} is empty, it will return {@code false}
 */
public static <A> boolean containsAll(Collection<A> container, Collection<A> collection) {
    if (container.isEmpty())
        return false;

    Set<A> set = new LinkedHashSet<A>(container);
    set.removeAll(collection);

    return set.isEmpty();
}

From source file:dk.clanie.actor.ActorAnnotationAdvisor.java

/**
 * Create a new ActorAnnotationAdvisor using the given task executor.
 * //from   w  w w  . j  a v a2  s  . com
 * @param executor the task executor to use for asynchronous methods
 */
public ActorAnnotationAdvisor(Executor executor) {
    Set<Class<? extends Annotation>> asyncAnnotationTypes = new LinkedHashSet<Class<? extends Annotation>>(2);
    asyncAnnotationTypes.add(Actor.class);
    this.advice = buildAdvice(executor);
    this.pointcut = new AnnotationMatchingPointcut(Actor.class, true);
}