All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.foursoft.vecmodel.vec120.AbstractVecMappingAssert Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package com.foursoft.vecmodel.vec120;

import org.assertj.core.internal.Iterables;
import org.assertj.core.util.Objects;

/**
 * Abstract base class for {@link VecMapping} specific assertions - Generated by CustomAssertionGenerator.
 */
@javax.annotation.Generated(value="assertj-assertions-generator")
public abstract class AbstractVecMappingAssert, A extends VecMapping> extends AbstractVecExtendableElementAssert {

  /**
   * Creates a new {@link AbstractVecMappingAssert} to make assertions on actual VecMapping.
   * @param actual the VecMapping we want to make assertions on.
   */
  protected AbstractVecMappingAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  /**
   * Verifies that the actual VecMapping's a is equal to the given one.
   * @param a the given a to compare the actual VecMapping's a to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecMapping's a is not equal to the given one.
   */
  public S hasA(VecPartVersion a) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting a of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    VecPartVersion actualA = actual.getA();
    if (!Objects.areEqual(actualA, a)) {
      failWithMessage(assertjErrorMessage, actual, a, actualA);
    }

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's b is equal to the given one.
   * @param b the given b to compare the actual VecMapping's b to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecMapping's b is not equal to the given one.
   */
  public S hasB(VecPartVersion b) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting b of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    VecPartVersion actualB = actual.getB();
    if (!Objects.areEqual(actualB, b)) {
      failWithMessage(assertjErrorMessage, actual, b, actualB);
    }

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's parentMappingSpecification is equal to the given one.
   * @param parentMappingSpecification the given parentMappingSpecification to compare the actual VecMapping's parentMappingSpecification to.
   * @return this assertion object.
   * @throws AssertionError - if the actual VecMapping's parentMappingSpecification is not equal to the given one.
   */
  public S hasParentMappingSpecification(VecMappingSpecification parentMappingSpecification) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // overrides the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting parentMappingSpecification of:\n  <%s>\nto be:\n  <%s>\nbut was:\n  <%s>";

    // null safe check
    VecMappingSpecification actualParentMappingSpecification = actual.getParentMappingSpecification();
    if (!Objects.areEqual(actualParentMappingSpecification, parentMappingSpecification)) {
      failWithMessage(assertjErrorMessage, actual, parentMappingSpecification, actualParentMappingSpecification);
    }

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings contains the given VecSlotMapping elements.
   * @param slotMappings the given elements that should be contained in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings does not contain all given VecSlotMapping elements.
   */
  public S hasSlotMappings(VecSlotMapping... slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping varargs is not null.
    if (slotMappings == null) failWithMessage("Expecting slotMappings parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getSlotMappings(), slotMappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings contains the given VecSlotMapping elements in Collection.
   * @param slotMappings the given elements that should be contained in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings does not contain all given VecSlotMapping elements.
   */
  public S hasSlotMappings(java.util.Collection slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping collection is not null.
    if (slotMappings == null) {
      failWithMessage("Expecting slotMappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContains(info, actual.getSlotMappings(), slotMappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings contains only the given VecSlotMapping elements and nothing else in whatever order.
   * @param slotMappings the given elements that should be contained in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings does not contain all given VecSlotMapping elements.
   */
  public S hasOnlySlotMappings(VecSlotMapping... slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping varargs is not null.
    if (slotMappings == null) failWithMessage("Expecting slotMappings parameter not to be null.");

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getSlotMappings(), slotMappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings contains only the given VecSlotMapping elements in Collection and nothing else in whatever order.
   * @param slotMappings the given elements that should be contained in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings does not contain all given VecSlotMapping elements.
   */
  public S hasOnlySlotMappings(java.util.Collection slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping collection is not null.
    if (slotMappings == null) {
      failWithMessage("Expecting slotMappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message, to set another message call: info.overridingErrorMessage("my error message");
    Iterables.instance().assertContainsOnly(info, actual.getSlotMappings(), slotMappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings does not contain the given VecSlotMapping elements.
   *
   * @param slotMappings the given elements that should not be in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings contains any given VecSlotMapping elements.
   */
  public S doesNotHaveSlotMappings(VecSlotMapping... slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping varargs is not null.
    if (slotMappings == null) failWithMessage("Expecting slotMappings parameter not to be null.");

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getSlotMappings(), slotMappings);

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping's slotMappings does not contain the given VecSlotMapping elements in Collection.
   *
   * @param slotMappings the given elements that should not be in actual VecMapping's slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings contains any given VecSlotMapping elements.
   */
  public S doesNotHaveSlotMappings(java.util.Collection slotMappings) {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // check that given VecSlotMapping collection is not null.
    if (slotMappings == null) {
      failWithMessage("Expecting slotMappings parameter not to be null.");
      return myself; // to fool Eclipse "Null pointer access" warning on toArray.
    }

    // check with standard error message (use overridingErrorMessage before contains to set your own message).
    Iterables.instance().assertDoesNotContain(info, actual.getSlotMappings(), slotMappings.toArray());

    // return the current assertion for method chaining
    return myself;
  }

  /**
   * Verifies that the actual VecMapping has no slotMappings.
   * @return this assertion object.
   * @throws AssertionError if the actual VecMapping's slotMappings is not empty.
   */
  public S hasNoSlotMappings() {
    // check that actual VecMapping we want to make assertions on is not null.
    isNotNull();

    // we override the default error message with a more explicit one
    String assertjErrorMessage = "\nExpecting :\n  <%s>\nnot to have slotMappings but had :\n  <%s>";

    // check
    if (actual.getSlotMappings().iterator().hasNext()) {
      failWithMessage(assertjErrorMessage, actual, actual.getSlotMappings());
    }

    // return the current assertion for method chaining
    return myself;
  }


}