Class IntentInstallationContext


  • public class IntentInstallationContext
    extends Object
    Installation context for a high level Intent. Records pending and error operation contexts of installable Intents for the high level Intent.
    • Constructor Detail

      • IntentInstallationContext

        public IntentInstallationContext​(IntentData toUninstall,
                                         IntentData toInstall)
        Creates an Intent installation context by given information.
        Parameters:
        toUninstall - the Intent to uninstall
        toInstall - the Intent to install
    • Method Detail

      • removePendingContext

        public void removePendingContext​(IntentOperationContext context)
        Removes a pending operation context.
        Parameters:
        context - the operation context to be added
      • addPendingContext

        public void addPendingContext​(IntentOperationContext context)
        Adds a pending context.
        Parameters:
        context - the operation context to be added
      • addErrorContext

        public void addErrorContext​(IntentOperationContext context)
        Adds an error context.
        Parameters:
        context - the error context to be added.
      • pendingContexts

        public Set<IntentOperationContext> pendingContexts()
        Retrieves the pending contexts.
        Returns:
        the pending contexts
      • errorContexts

        public Set<IntentOperationContext> errorContexts()
        Retrieves the error contexts.
        Returns:
        the error contexts
      • isPendingContextsEmpty

        public boolean isPendingContextsEmpty()
        Check if pending context is empty.
        Returns:
        true if pending contexts is empty; false otherwise
      • toUninstall

        public Optional<IntentData> toUninstall()
        Retrieves the Intent data which to be uninstalled.
        Returns:
        the Intent data; empty value if not exists
      • toInstall

        public Optional<IntentData> toInstall()
        Retrieves the Intent data which to be installed.
        Returns:
        the Intent data; empty value if not exists