Class ChangeUtils


  • public final class ChangeUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T>
      extractCreated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes, java.lang.Class<T> clazz)
      Extract all the instances of clazz which were created in the given set of modifications.
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T>
      extractCreatedOrUpdated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes, java.lang.Class<T> clazz, java.util.function.Predicate<org.opendaylight.mdsal.binding.api.DataObjectModification<T>> filter)
      Extract all the instance of clazz which were created or updated in the given set of modifications, and which satisfy the given filter.
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T>
      extractOriginal​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes, java.lang.Class<T> clazz)
      Extract the original instances of class clazz in the given set of modifications.
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Set<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>>
      extractRemoved​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes, java.lang.Class<T> clazz)
      Extract the instance identifier of removed instances of clazz from the given set of modifications.
      static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject>
      java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T>
      extractUpdated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes, java.lang.Class<T> clazz)
      Extract all the instances of clazz which were updated in the given set of modifications.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • extractCreated

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T> extractCreated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes,
                                                                                                                                                                                                                                                            java.lang.Class<T> clazz)
        Extract all the instances of clazz which were created in the given set of modifications.
        Type Parameters:
        T - The type of changes we're interested in.
        U - The type of changes to process.
        Parameters:
        changes - The changes to process.
        clazz - The class we're interested in.
        Returns:
        The created instances, mapped by instance identifier.
      • extractUpdated

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T> extractUpdated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes,
                                                                                                                                                                                                                                                            java.lang.Class<T> clazz)
        Extract all the instances of clazz which were updated in the given set of modifications.
        Type Parameters:
        T - The type of changes we're interested in.
        U - The type of changes to process.
        Parameters:
        changes - The changes to process.
        clazz - The class we're interested in.
        Returns:
        The updated instances, mapped by instance identifier.
      • extractCreatedOrUpdated

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T> extractCreatedOrUpdated​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes,
                                                                                                                                                                                                                                                                     java.lang.Class<T> clazz,
                                                                                                                                                                                                                                                                     java.util.function.Predicate<org.opendaylight.mdsal.binding.api.DataObjectModification<T>> filter)
        Extract all the instance of clazz which were created or updated in the given set of modifications, and which satisfy the given filter.
        Type Parameters:
        T - The type of changes we're interested in.
        U - The type of changes to process.
        Parameters:
        changes - The changes to process.
        clazz - The class we're interested in.
        filter - The filter the changes must satisfy.
        Returns:
        The created or updated instances which satisfy the filter, mapped by instance identifier.
      • extractOriginal

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Map<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>,​T> extractOriginal​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes,
                                                                                                                                                                                                                                                             java.lang.Class<T> clazz)
        Extract the original instances of class clazz in the given set of modifications.
        Type Parameters:
        T - The type of changes we're interested in.
        U - The type of changes to process.
        Parameters:
        changes - The changes to process.
        clazz - The class we're interested in.
        Returns:
        The original instances, mapped by instance identifier.
      • extractRemoved

        public static <T extends org.opendaylight.yangtools.yang.binding.DataObject,​U extends org.opendaylight.yangtools.yang.binding.DataObject> java.util.Set<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T>> extractRemoved​(java.util.Collection<org.opendaylight.mdsal.binding.api.DataTreeModification<U>> changes,
                                                                                                                                                                                                                                                    java.lang.Class<T> clazz)
        Extract the instance identifier of removed instances of clazz from the given set of modifications.
        Type Parameters:
        T - The type of changes we're interested in.
        U - The type of changes to process.
        Parameters:
        changes - The changes to process.
        clazz - The class we're interested in.
        Returns:
        The instance identifiers of removed instances.