Java List Difference differentCategory(String prop1, String prop2, List cat1, List cat2)

Here you can find the source of differentCategory(String prop1, String prop2, List cat1, List cat2)

Description

checks if one property belongs to some category and the other to different category

License

Open Source License

Declaration

public static boolean differentCategory(String prop1, String prop2, List<String> cat1, List<String> cat2) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**//from  www . ja v  a2 s.  co  m
     * checks if one property belongs to some category and the other to different category
     */
    public static boolean differentCategory(String prop1, String prop2, List<String> cat1, List<String> cat2) {
        return !(cat1 == null || cat2 == null || cat1.isEmpty() || cat2.isEmpty())
                && ((cat1.contains(prop1) && cat2.contains(prop2))
                        || (cat1.contains(prop2) && cat2.contains(prop1)));
    }
}

Related

  1. difference(final String[] list1, final String[] list2)
  2. difference(List firstList, List secondList)
  3. difference(List lst1, List lst2)
  4. difference(List set1, List set2)
  5. differenceOfList(List a, List b)
  6. diffFloats(List a, List b)
  7. diffList(List aList, List bList)
  8. diffSet(List a, List b)
  9. diffSimple(String name, Object expected, Object actual, List messages)