Class ModelContexts


  • public class ModelContexts
    extends Object
    Common code and constants for ModelContext implementations.
    • Field Detail

      • metadataId

        static final UUID metadataId
    • Constructor Detail

      • ModelContexts

        private ModelContexts()
    • Method Detail

      • merge

        public static void merge​(ModelContext context,
                                 ModelContext otherContext)
        Merge two ModelContext objects. The merge results will be the first context. Each Propertyset in the contexts will be merged separately. If a propertyset in otherContext doesn't exist in context it will be copied into context. The primitive values are immutable and will be reused. Complex properties and list properties will be copied to avoid thread synchronization issues. Propertyset instances that exist in both contexts will result in the values of the Propertyset instance in one context being copied into the Propertyset instance in the other context. Which Propertyset is copied into and which is copied from, depends on the lastmodified time of the Propertyset (newest Propertyset is copied from and oldest Propertyset is copied into, potentially overwriting properties with the same name). For ModelContext implementations with no lastmodifiedtime information otherContext propertysets will be copied into context propertysets.
        Parameters:
        context - the context that will contain the merge results
        otherContext - the context that is merged into the other context, this context is unchanged after the merge
      • addMissingPropertysetToContext

        private static void addMissingPropertysetToContext​(ModelContext context,
                                                           UUID propertysetId,
                                                           Propertyset propertyset)