Example usage for java.util LinkedHashSet equals

List of usage examples for java.util LinkedHashSet equals

Introduction

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

Prototype

boolean equals(Object o);

Source Link

Document

Compares the specified object with this set for equality.

Usage

From source file:org.asqatasun.referential.creator.CodeGeneratorMojo.java

private void extractAvailableLangsFromCsvHeader(String[] csvHeaders) throws I18NLanguageNotFoundException {
    LinkedHashSet<String> themeList = new LinkedHashSet<>();
    LinkedHashSet<String> critereList = new LinkedHashSet<>();
    LinkedHashSet<String> testList = new LinkedHashSet<>();
    for (String header : csvHeaders) {
        if (header.startsWith(THEME_LABEL_COLUMN_NAME)) {
            themeList.add(header.split("_")[1]);
        } else if (header.startsWith(CRITERION_LABEL_COLUMN_NAME)) {
            critereList.add(header.split("_")[1]);
        } else if (header.startsWith(TEST_LABEL_COLUMN_NAME)) {
            testList.add(header.split("_")[1]);
        }//  w w w  .  jav  a2s  . c o m
    }
    if (isCriterionPresent) {
        if (themeList.equals(critereList) && testList.equals(critereList)) {
            langSet.addAll(themeList);
        } else {
            throw new I18NLanguageNotFoundException("All Label on csv column must have internationalization");
        }
    } else {
        if (themeList.equals(testList)) {
            langSet.addAll(themeList);
        } else {
            throw new I18NLanguageNotFoundException("All Label on csv column must have internationalization");
        }
    }
}

From source file:org.opens.referentiel.creator.CodeGeneratorMojo.java

private void extractAvailableLangsFromCsvHeader(String[] csvHeaders) throws I18NLanguageNotFoundException {
    LinkedHashSet<String> themeList = new LinkedHashSet();
    LinkedHashSet<String> critereList = new LinkedHashSet();
    LinkedHashSet<String> testList = new LinkedHashSet();
    for (String header : csvHeaders) {
        if (header.startsWith(THEME_LABEL_COLUMN_NAME)) {
            themeList.add(header.split("_")[1]);
        } else if (header.startsWith(CRITERION_LABEL_COLUMN_NAME)) {
            critereList.add(header.split("_")[1]);
        } else if (header.startsWith(TEST_LABEL_COLUMN_NAME)) {
            testList.add(header.split("_")[1]);
        }/*from  ww  w.  j  a  v a2 s.c om*/
    }
    if (isCriterionPresent) {
        if (themeList.equals(critereList) && testList.equals(critereList)) {
            langSet.addAll(themeList);
        } else {
            throw new I18NLanguageNotFoundException("All Label on csv column must have internationalization");
        }
    } else {
        if (themeList.equals(testList)) {
            langSet.addAll(themeList);
        } else {
            throw new I18NLanguageNotFoundException("All Label on csv column must have internationalization");
        }
    }
}