Class Shortcut


  • public final class Shortcut
    extends java.lang.Object
    The Shortcut class describes a shortcut (a short way) to address a group of operations within the operation tree (some specific path) that describes a composite operation. In most specifications, there are paths in the operation tree can be built in an unambiguous way (without a need for external information or a client decision). To simplify describing composite instructions calls in test templates, all such paths are saved as shortcuts associated with their target operations (the point there the path ends, the most important operation that distinguishes a specific path from other similar paths).
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Shortcut.Argument
      The Argument class describes shortcut arguments (arguments of a composite operation).
    • Constructor Detail

      • Shortcut

        public Shortcut​(PrimitiveAnd entry,
                        PrimitiveAnd target,
                        java.util.List<java.lang.String> contextNames)
        Constructs a shortcut object. The shortcut object describes how to create the target operation and all other operations it requires from the starting point called entry. The context is the name of the operation that accepts as an argument the composite operation built with the help of the shortcut. The map of arPrimitiveguments is built by traversing the path.
        Parameters:
        entry - The entry point where the path starts (the top point).
        target - The target operation of the shortcut.
        contextNames - The list of names that identify the contexts in which the shortcut can be called.
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments is null; if target or entry is not an operation; if an operation on the shortcut path is an OR-rule (all OR-rules must be resolved at this point).
      • Shortcut

        public Shortcut​(PrimitiveAnd entry,
                        PrimitiveAnd target,
                        java.lang.String contextName)
        Constructor than uses one context name.
        Parameters:
        entry - The entry point where the path starts (the top point).
        target - The target operation of the shortcut.
        contextName - The name that identify the context in which the shortcut can be called.
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments is null; if target or entry is not an operation; if an operation on the shortcut path is an OR-rule (all OR-rules must be resolved at this point).
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the shortcut. Corresponds to the name of the target operation.
        Returns:
        Shortcut name.
      • getEntry

        public PrimitiveAnd getEntry()
        Returns the entry operation.
        Returns:
        Entry operation.
      • getTarget

        public PrimitiveAnd getTarget()
        Returns the target operation.
        Returns:
        Target operation.
      • getContextName

        public java.util.List<java.lang.String> getContextName()
        Returns the list of context identifiers (names of operations that accept the composite object created by the shortcut as an argument).
        Returns:
        List of context identifiers.
      • getArguments

        public java.util.Collection<Shortcut.Argument> getArguments()
        Returns a collection of shortcut arguments.
        Returns:
        Shortcut arguments.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object