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

org.assertj.vavr.api.soft.StandardSoftVavrAssertionsProvider Maven / Gradle / Ivy

There is a newer version: 0.4.3
Show newest version
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 * Copyright 2017-2021 the original author or authors.
 */
package org.assertj.vavr.api.soft;

import io.vavr.Lazy;
import io.vavr.collection.List;
import io.vavr.collection.Map;
import io.vavr.collection.Multimap;
import io.vavr.collection.Seq;
import io.vavr.collection.Set;
import io.vavr.control.Either;
import io.vavr.control.Option;
import io.vavr.control.Try;
import io.vavr.control.Validation;
import org.assertj.core.api.StandardSoftAssertionsProvider;
import org.assertj.core.util.CheckReturnValue;
import org.assertj.vavr.api.EitherAssert;
import org.assertj.vavr.api.LazyAssert;
import org.assertj.vavr.api.MapAssert;
import org.assertj.vavr.api.MultimapAssert;
import org.assertj.vavr.api.OptionAssert;
import org.assertj.vavr.api.SeqAssert;
import org.assertj.vavr.api.SetAssert;
import org.assertj.vavr.api.TryAssert;
import org.assertj.vavr.api.ValidationAssert;

public interface StandardSoftVavrAssertionsProvider extends StandardSoftAssertionsProvider {

    /**
     * Creates assertion for {@link io.vavr.control.Either}.
     *
     * @param   the type of a value contained on left by actual {@link Either}.
     * @param  the type of a value contained on right by actual {@link Either}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  EitherAssert assertThat(Either actual) {
        return proxy(EitherAssert.class, Either.class, actual);
    }

    /**
     * Creates assertion for {@link Lazy}.
     *
     * @param  the type of a value contained by actual {@link Lazy}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  LazyAssert assertThat(Lazy actual) {
        return proxy(LazyAssert.class, Lazy.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.control.Option}.
     *
     * @param  the type of a value contained by actual {@link Option}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  OptionAssert assertThat(Option actual) {
        return proxy(OptionAssert.class, Option.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.control.Try}.
     *
     * @param  the type of a value contained by actual {@link Try}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  TryAssert assertThat(Try actual) {
        return proxy(TryAssert.class, Try.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.collection.List}.
     *
     * @param  the type of elements contained by actual {@link List}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  SeqAssert assertThat(Seq actual) {
        return proxy(SeqAssert.class, Seq.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.control.Validation}.
     *
     * @param  type of the value in the case of the invalid {@link Validation}.
     * @param    type of the value in the case of the valid {@link Validation}.
     * @param actual    the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  ValidationAssert assertThat(Validation actual) {
        return proxy(ValidationAssert.class, Validation.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.collection.Set}.
     *
     * @param  the type of elements contained by  actual {@link Set}.
     * @param actual the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  SetAssert assertThat(Set actual) {
        return proxy(SetAssert.class, Set.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.collection.Map}.
     *
     * @param    key type of the {@link Map}.
     * @param  value type of the {@link Map}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  MapAssert assertThat(Map actual) {
        return proxy(MapAssert.class, Map.class, actual);
    }

    /**
     * Creates assertion for {@link io.vavr.collection.Multimap}.
     *
     * @param    key type of the {@link Multimap}.
     * @param  value type of the {@link Multimap}.
     * @param actual  the actual value.
     * @return the created assertion object.
     */
    @CheckReturnValue
    @SuppressWarnings("unchecked")
    default  MultimapAssert assertThat(Multimap actual) {
        return proxy(MultimapAssert.class, Multimap.class, actual);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy