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() 

Source Link

Document

Constructs a new, empty linked hash set with the default initial capacity (16) and load factor (0.75).

Usage

From source file:org.ahp.commons.validator.AbstractValidator.java

/**
 * /*from ww w  .  jav a 2s. c om*/
 * @param pEmailAddress
 * @param pErrorKeyPrefix
 * @return
 */
public static Set<String> validateEmailAddress(String pEmailAddress, String pErrorKeyPrefix) {
    Set<String> lErrorKeySet = new LinkedHashSet<String>();
    if (pEmailAddress == null || "".equals(pEmailAddress)) {
        lErrorKeySet.add(pErrorKeyPrefix + ".email.required");
        return lErrorKeySet;
    }
    /*if ( pEmailAddress.length() < EMAIL_ADDRESS_MIN_LENGTH ) {
    lErrorKeySet.add( pErrorKeyPrefix + ".email.min" ); 
    return lErrorKeySet;
    } 
    if ( pEmailAddress.length() > EMAIL_ADDRESS_MAX_LENGTH ) { 
    lErrorKeySet.add( pErrorKeyPrefix + ".email.max" ); 
    }*/
    if (!ValidatorUtil.validateAllowedCharacters(pEmailAddress, EMAIL_ADDRESS_ALLOWED_REGEX)) {
        lErrorKeySet.add(pErrorKeyPrefix + ".email.notvalid");
    }
    return lErrorKeySet;
}

From source file:io.servicecomb.transport.rest.servlet.CseXmlWebApplicationContext.java

private String[] splitLocations(String locations) {
    Set<String> locationSet = new LinkedHashSet<>();
    if (!StringUtils.isEmpty(locations)) {
        for (String location : locations.split("[,\n]")) {
            location = location.trim();/*  ww w  .  jav a 2  s .com*/
            if (StringUtils.isEmpty(location)) {
                continue;
            }

            locationSet.add(location);
        }
    }

    if (!StringUtils.isEmpty(defaultBeanResource)) {
        locationSet.add(defaultBeanResource);
    }

    return locationSet.toArray(new String[locationSet.size()]);
}

From source file:facebook4j.TargetingParameter.java

public TargetingParameter city(String city) {
    if (cities == null) {
        cities = new LinkedHashSet<String>();
    }// ww  w .j av  a2  s .  c om
    cities.add(city);
    return this;
}

From source file:com.hp.autonomy.aci.content.printfields.PrintFields.java

private PrintFields doAppend(final Iterable<String> fields) {
    Validate.notNull(fields, "Values must not be null");

    // In case of nulls, build a new Set and then add them all
    final Set<String> newFields = new LinkedHashSet<String>();

    for (final String field : fields) {
        Validate.isTrue(StringUtils.isNotBlank(field), "One of the fields provided was blank");
        Validate.isTrue(!INVALID.matcher(field).matches(),
                "A field name cannot contain a plus, comma or whitespace: [" + field + ']');

        newFields.add(field);//from   w  ww .j a v  a2s  .c om
    }

    this.values.addAll(newFields);

    return this;
}

From source file:gr.abiss.calipso.domain.SpaceRole.java

public SpaceRole(Space space, String description, RoleType roleType) {
    this.space = space;
    this.description = description;
    this.roleTypeId = roleType.getId();
    this.roleCode = createRoleCode();
    this.userSpaceRoles = new LinkedHashSet<UserSpaceRole>();
    this.roleSpaceStdFields = new LinkedHashSet<RoleSpaceStdField>();
}

From source file:com.smartitengineering.loadtest.engine.impl.management.AbstracltTestCaseBatchCreator.java

protected AbstracltTestCaseBatchCreator() {
    setNextBatchAvailable(false);
    setInitialized(false);
    batchListeners = new LinkedHashSet<TestCaseBatchListener>();
}

From source file:net.sf.dynamicreports.design.transformation.chartcustomizer.SeriesColorsByNameCustomizer.java

@Override
public void customize(JFreeChart chart, ReportParameters reportParameters) {
    if (chart.getPlot() instanceof CategoryPlot) {
        CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer();
        CategoryDataset dataset = chart.getCategoryPlot().getDataset();
        Set<String> legend = new LinkedHashSet<String>();
        if (dataset != null) {
            for (int i = 0; i < dataset.getRowCount(); i++) {
                String key = (String) dataset.getRowKey(i);
                if (renderer instanceof GroupedStackedBarRenderer) {
                    key = StringUtils.substringAfter(key, GroupedStackedBarRendererCustomizer.GROUP_SERIES_KEY);
                    legend.add(key);/* ww w .  ja v  a 2  s. c o m*/
                }
                renderer.setSeriesPaint(i, seriesColorsByName.get(key));
            }
        }
        if (!legend.isEmpty()) {
            LegendItemCollection legendItems = new LegendItemCollection();
            for (String item : legend) {
                legendItems.add(new LegendItem(item, seriesColorsByName.get(item)));
            }
            chart.getCategoryPlot().setFixedLegendItems(legendItems);
        }
    } else if (chart.getPlot() instanceof PiePlot) {
        PiePlot plot = (PiePlot) chart.getPlot();
        PieDataset dataset = plot.getDataset();
        for (int i = 0; i < dataset.getItemCount(); i++) {
            String key = (String) dataset.getKey(i);
            plot.setSectionPaint(key, seriesColorsByName.get(key));
        }
    } else if (chart.getPlot() instanceof XYPlot) {
        XYItemRenderer renderer = chart.getXYPlot().getRenderer();
        XYDataset dataset = chart.getXYPlot().getDataset();
        for (int i = 0; i < dataset.getSeriesCount(); i++) {
            String key = (String) dataset.getSeriesKey(i);
            renderer.setSeriesPaint(i, seriesColorsByName.get(key));
        }
    }
}

From source file:org.bremersee.common.spring.autoconfigure.JerseyComponentsCustomizer.java

private Set<Object> createComponentSet() {
    final Set<Object> componentSet = new LinkedHashSet<>();
    for (JerseyComponentsProvider provider : componentProviders) {
        final Object[] components = provider.getJerseyComponents() == null ? new Object[0]
                : provider.getJerseyComponents();
        for (final Object component : components) {
            if (component != null) {
                componentSet.add(component);
            }//from w  w w . j  a v  a 2  s  .c  o  m
        }
    }
    return componentSet;
}

From source file:edu.uci.ics.jung.graph.DirectedOrderedSparseMultigraph.java

@Override
public Collection<V> getSuccessors(V vertex) {
    if (!containsVertex(vertex))
        return null;
    Set<V> succs = new LinkedHashSet<V>();
    for (E edge : getOutgoing_internal(vertex))
        succs.add(this.getDest(edge));

    return Collections.unmodifiableCollection(succs);
}