Package com.evolveum.midpoint.prism
Class PrismValueCollectionsUtil
- java.lang.Object
-
- com.evolveum.midpoint.prism.PrismValueCollectionsUtil
-
public class PrismValueCollectionsUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description PrismValueCollectionsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull List<Referencable>
asReferencables(@NotNull Collection<PrismReferenceValue> values)
static @NotNull List<PrismReferenceValue>
asReferenceValues(@NotNull Collection<? extends Referencable> referencables)
static <T> void
clearParent(List<PrismPropertyValue<T>> values)
static <T extends PrismValue>
@NotNull Collection<T>cloneCollection(Collection<T> values)
static <T extends PrismValue>
@NotNull Collection<T>cloneCollectionComplex(CloneStrategy strategy, Collection<T> values)
static <X extends PrismValue>
Collection<X>cloneValues(Collection<X> values)
static <V extends PrismValue>
booleancollectionContainsEquivalentValue(Collection<V> collection, V value, ParameterizedEquivalenceStrategy equivalenceStrategy)
static <V extends PrismValue>
booleancontains(Collection<V> thisSet, V otherValue, EquivalenceStrategy strategy)
static <V extends PrismValue>
booleancontainsAll(Collection<V> thisSet, Collection<V> otherSet, EquivalenceStrategy strategy)
static boolean
containsOid(Collection<PrismReferenceValue> values, @NotNull String oid)
static boolean
containsRealValue(Collection<PrismPropertyValue<?>> collection, PrismPropertyValue<?> value)
static <V extends PrismValue>
booleancontainsRealValue(Collection<V> collection, V value)
static <X,V extends PrismValue>
booleancontainsRealValue(Collection<X> collection, V value, Function<X,V> valueExtractor)
static <T> boolean
containsValue(Collection<PrismPropertyValue<T>> collection, PrismPropertyValue<T> value, EqualsChecker<PrismPropertyValue<T>> checker)
static <T> Collection<PrismPropertyValue<T>>
createCollection(PrismContext prismContext, Collection<T> realValueCollection)
static <T> Collection<PrismPropertyValue<T>>
createCollection(PrismContext prismContext, T[] realValueArray)
static Collection<? extends PrismValue>
differenceConsideringIds(@NotNull Collection<? extends PrismValue> collection1, @NotNull Collection<? extends PrismValue> collection2, @NotNull EquivalenceStrategy strategy)
Returns values present in `collection1` but not in `collection2`.static <V extends PrismValue>
booleanequalsRealValues(Collection<V> collection1, Collection<V> collection2)
static <T> Set<T>
getRealValuesOfCollection(Collection<? extends PrismValue> collection)
static <T> Set<T>
getRealValuesOfCollectionPreservingNull(Collection<? extends PrismValue> collection)
static <T> Collection<T>
getValues(Collection<PrismPropertyValue<T>> pvals)
static Collection<? extends PrismValue>
intersection(@NotNull Collection<? extends PrismValue> collection1, @NotNull Collection<? extends PrismValue> collection2, @NotNull EquivalenceStrategy strategy)
Returns values present in `collection1` as well as in `collection2`.static <T extends PrismValue>
Collection<T>resetParentCollection(Collection<T> values)
Sets all parents to null.static Collection<? extends PrismValue>
sameIdDifferentContent(@NotNull Collection<? extends PrismValue> collection1, @NotNull Collection<? extends PrismValue> collection2, @NotNull EquivalenceStrategy strategy)
Returns values that exist (by ID) in both collections but differ in content.static <O extends Objectable,C extends Containerable>
Collection<PrismContainerValue<C>>toPrismContainerValues(Class<O> type, ItemPath path, PrismContext prismContext, C... containerValues)
static <X> Collection<PrismPropertyValue<X>>
toPrismPropertyValues(PrismContext prismContext, X... realValues)
static Collection<PrismValue>
toPrismValues(Object... realValues)
static <T> Collection<PrismPropertyValue<T>>
wrap(PrismContext prismContext, @NotNull Collection<T> realValues)
static <T> PrismPropertyValue<T>[]
wrap(PrismContext prismContext, T... realValues)
-
-
-
Method Detail
-
getValues
public static <T> Collection<T> getValues(Collection<PrismPropertyValue<T>> pvals)
-
containsRealValue
public static boolean containsRealValue(Collection<PrismPropertyValue<?>> collection, PrismPropertyValue<?> value)
-
containsValue
public static <T> boolean containsValue(Collection<PrismPropertyValue<T>> collection, PrismPropertyValue<T> value, EqualsChecker<PrismPropertyValue<T>> checker)
-
createCollection
public static <T> Collection<PrismPropertyValue<T>> createCollection(PrismContext prismContext, Collection<T> realValueCollection)
-
createCollection
public static <T> Collection<PrismPropertyValue<T>> createCollection(PrismContext prismContext, T[] realValueArray)
-
wrap
public static <T> Collection<PrismPropertyValue<T>> wrap(PrismContext prismContext, @NotNull @NotNull Collection<T> realValues)
-
wrap
@SafeVarargs public static <T> PrismPropertyValue<T>[] wrap(PrismContext prismContext, T... realValues)
-
asReferencables
@NotNull public static @NotNull List<Referencable> asReferencables(@NotNull @NotNull Collection<PrismReferenceValue> values)
-
asReferenceValues
@NotNull public static @NotNull List<PrismReferenceValue> asReferenceValues(@NotNull @NotNull Collection<? extends Referencable> referencables)
-
containsOid
public static boolean containsOid(Collection<PrismReferenceValue> values, @NotNull @NotNull String oid)
-
clearParent
public static <T> void clearParent(List<PrismPropertyValue<T>> values)
-
containsRealValue
public static <V extends PrismValue> boolean containsRealValue(Collection<V> collection, V value)
-
equalsRealValues
public static <V extends PrismValue> boolean equalsRealValues(Collection<V> collection1, Collection<V> collection2)
-
containsAll
public static <V extends PrismValue> boolean containsAll(Collection<V> thisSet, Collection<V> otherSet, EquivalenceStrategy strategy)
-
cloneCollection
@NotNull public static <T extends PrismValue> @NotNull Collection<T> cloneCollection(Collection<T> values)
-
resetParentCollection
public static <T extends PrismValue> Collection<T> resetParentCollection(Collection<T> values)
Sets all parents to null. This is good if the items are to be "transplanted" into a different Containerable.
-
getRealValuesOfCollectionPreservingNull
public static <T> Set<T> getRealValuesOfCollectionPreservingNull(Collection<? extends PrismValue> collection)
-
getRealValuesOfCollection
public static <T> Set<T> getRealValuesOfCollection(Collection<? extends PrismValue> collection)
-
containsRealValue
public static <X,V extends PrismValue> boolean containsRealValue(Collection<X> collection, V value, Function<X,V> valueExtractor)
-
contains
public static <V extends PrismValue> boolean contains(Collection<V> thisSet, V otherValue, EquivalenceStrategy strategy)
-
cloneValues
public static <X extends PrismValue> Collection<X> cloneValues(Collection<X> values)
-
cloneCollectionComplex
@NotNull public static <T extends PrismValue> @NotNull Collection<T> cloneCollectionComplex(CloneStrategy strategy, Collection<T> values)
-
collectionContainsEquivalentValue
public static <V extends PrismValue> boolean collectionContainsEquivalentValue(Collection<V> collection, V value, ParameterizedEquivalenceStrategy equivalenceStrategy)
-
toPrismPropertyValues
public static <X> Collection<PrismPropertyValue<X>> toPrismPropertyValues(PrismContext prismContext, X... realValues)
-
toPrismContainerValues
public static <O extends Objectable,C extends Containerable> Collection<PrismContainerValue<C>> toPrismContainerValues(Class<O> type, ItemPath path, PrismContext prismContext, C... containerValues) throws SchemaException
- Throws:
SchemaException
-
toPrismValues
public static Collection<PrismValue> toPrismValues(Object... realValues)
-
differenceConsideringIds
public static Collection<? extends PrismValue> differenceConsideringIds(@NotNull @NotNull Collection<? extends PrismValue> collection1, @NotNull @NotNull Collection<? extends PrismValue> collection2, @NotNull @NotNull EquivalenceStrategy strategy)
Returns values present in `collection1` but not in `collection2`. Values matching by ID are treated as equal without looking at their content.
-
sameIdDifferentContent
public static Collection<? extends PrismValue> sameIdDifferentContent(@NotNull @NotNull Collection<? extends PrismValue> collection1, @NotNull @NotNull Collection<? extends PrismValue> collection2, @NotNull @NotNull EquivalenceStrategy strategy)
Returns values that exist (by ID) in both collections but differ in content.
-
intersection
public static Collection<? extends PrismValue> intersection(@NotNull @NotNull Collection<? extends PrismValue> collection1, @NotNull @NotNull Collection<? extends PrismValue> collection2, @NotNull @NotNull EquivalenceStrategy strategy)
Returns values present in `collection1` as well as in `collection2`. PCV IDs are NOT considered! We are interested here in really matching values.
-
-