Package: org.apache.groovy.contracts.domain

## [Java] Class AssertionMap<T extends Assertion<T>>

- org.apache.groovy.contracts.domain.AssertionMap

- All Implemented Interfaces and Traits:
    Iterable

      public class AssertionMap<T extends Assertion<T>>
      extends Object
      implements Iterable

  Maps methods to their accumulated contract assertions.

  Type Parameters:
    `T` - the assertion type stored for each method

- - ### Constructor Summary

    Constructors
    Constructor and description
    `AssertionMap()` Creates an empty assertion map.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `and(MethodNode methodNode, T assertion)` Adds the given assertion to the method entry using logical conjunction.
    `` | `public boolean` | `contains(MethodNode methodNode)` Indicates whether an assertion has already been recorded for the given method.
    `` | `public T` | `get(MethodNode methodNode)` Returns the assertion associated with the supplied method.
    `` | `public Iterator<Map.Entry<MethodNode, T>>` | `iterator()` Returns an iterator over the stored method/assertion pairs.
    `` | `public void` | `join(MethodNode methodNode, T assertion)` Joins the assertion into the method entry using the default merge strategy.
    `` | `public void` | `or(MethodNode methodNode, T assertion)` Adds the given assertion to the method entry using logical disjunction.
    `` | `public int` | `size()` Returns the number of method entries currently stored.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public AssertionMap()

      Creates an empty assertion map.

  - ### Method Detail

    - #### public void and(MethodNode methodNode, T assertion)

      Adds the given assertion to the method entry using logical conjunction.

      Parameters:
        `methodNode` - the method whose assertion should be updated
        `assertion` - the assertion to merge

    - #### public boolean contains(MethodNode methodNode)

      Indicates whether an assertion has already been recorded for the given method.

      Parameters:
        `methodNode` - the method to look up
      Returns:
        `true` if an assertion is present

    - #### public T get(MethodNode methodNode)

      Returns the assertion associated with the supplied method.

      Parameters:
        `methodNode` - the method to look up
      Returns:
        the matching assertion, or `null` if none has been stored

    - #### public Iterator<Map.Entry<MethodNode, T>> iterator()

      Returns an iterator over the stored method/assertion pairs.

      Returns:
        an iterator across the current entries

    - #### public void join(MethodNode methodNode, T assertion)

      Joins the assertion into the method entry using the default merge strategy.

      Parameters:
        `methodNode` - the method whose assertion should be updated
        `assertion` - the assertion to merge

    - #### public void or(MethodNode methodNode, T assertion)

      Adds the given assertion to the method entry using logical disjunction.

      Parameters:
        `methodNode` - the method whose assertion should be updated
        `assertion` - the assertion to merge

    - #### public int size()

      Returns the number of method entries currently stored.

      Returns:
        the assertion entry count