public class SetUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addAllIfNotPresent(Set<Object> set,
Set<Object> values) |
static Set<Object> |
attributeToSet(Attribute attr)
Return a new HashSet containing all the Objects that are an Attribute's
values.
|
static boolean |
checkOrder(Set<?> first,
Set<Object> second)
Check that two supposed identical sets are stored
in the same order.
|
static boolean |
doSetsMatch(Set<Object> srcAttrValues,
Set<Object> dstAttrValues)
Compare two lists of values to see if they contain the same values.
|
static boolean |
doSetsMatchWithOrder(Set<Object> srcAttrValues,
Set<Object> dstAttrValues)
Compare two lists of values to see if they contain the same values and in same order.
|
static Set<Object> |
findMissingNeedles(Set<?> haystack,
Set<Object> needles)
Find missing needles from a haystack.
|
static boolean |
setContainsAll(Set<Object> haystack,
Set<Object> needles)
Check to make sure all needles are in the haystack.
|
static Attribute |
setToAttribute(String attrName,
Set<?> values)
Return an Attribute containing all the Objects that are in a Set.
|
public static Set<Object> attributeToSet(Attribute attr) throws NamingException
attr
- An Attribute containing values to extract.HashSet
NamingException
public static Attribute setToAttribute(String attrName, Set<?> values)
attrName
- The name of the attribute to returnvalues
- Values as a setpublic static Set<Object> findMissingNeedles(Set<?> haystack, Set<Object> needles)
haystack
- Set of Objects to find the needles in.needles
- Set of Objects to search for in the haystack.Set
of needles that are not in the haystack.public static boolean checkOrder(Set<?> first, Set<Object> second)
first
- First set of Objects to compare.second
- Second set of Objects.boolean
if the order is the same.public static boolean setContainsAll(Set<Object> haystack, Set<Object> needles)
haystack
- Set of Objects to find the needles in.needles
- Set of Objects to search for in the haystack.public static boolean doSetsMatch(Set<Object> srcAttrValues, Set<Object> dstAttrValues)
srcAttrValues
- dstAttrValues
- public static boolean doSetsMatchWithOrder(Set<Object> srcAttrValues, Set<Object> dstAttrValues)
srcAttrValues
- dstAttrValues
- Copyright © 2005-2024 LSC project. All Rights Reserved.