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

com.pronoia.hapi.hamcrest.TerserMatchers Maven / Gradle / Ivy

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.
 */
package com.pronoia.hapi.hamcrest;

import java.util.regex.Pattern;

import ca.uhn.hl7v2.util.Terser;

import com.pronoia.hapi.hamcrest.terser.TerserSpecificationValueContains;
import com.pronoia.hapi.hamcrest.terser.TerserSpecificationValueEndsWith;
import com.pronoia.hapi.hamcrest.terser.TerserSpecificationValueIsEqual;
import com.pronoia.hapi.hamcrest.terser.TerserSpecificationValueMatchesPattern;
import com.pronoia.hapi.hamcrest.terser.TerserSpecificationValueStartsWith;

public final class TerserMatchers {
    private TerserMatchers() {
    }

    public static TerserSpecificationValueIsEqual valueEqualTo(String spec, String expected) {
        return valueEqualTo(spec, expected, false);
    }

    public static TerserSpecificationValueIsEqual valueEqualTo(String spec, String expected, boolean useGenericMessage) {
        return new TerserSpecificationValueIsEqual(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueIsEqual valueEqualTo(String spec, Terser expectedTerser) {
        return valueEqualTo(spec, expectedTerser, false);
    }

    public static TerserSpecificationValueIsEqual valueEqualTo(String spec, Terser expectedTerser, boolean useGenericMessage) {
        return new TerserSpecificationValueIsEqual(spec, useGenericMessage, expectedTerser);
    }

    public static TerserSpecificationValueStartsWith valueStartsWith(String spec, String expected) {
        return valueStartsWith(spec, expected, false);
    }

    public static TerserSpecificationValueStartsWith valueStartsWith(String spec, String expected, boolean useGenericMessage) {
        return new TerserSpecificationValueStartsWith(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueEndsWith valueEndsWith(String spec, String expected) {
        return valueEndsWith(spec, expected, false);
    }

    public static TerserSpecificationValueEndsWith valueEndsWith(String spec, String expected, boolean useGenericMessage) {
        return new TerserSpecificationValueEndsWith(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueContains valueContains(String spec, String expected) {
        return valueContains(spec, expected, false);
    }

    public static TerserSpecificationValueContains valueContains(String spec, String expected, boolean useGenericMessage) {
        return new TerserSpecificationValueContains(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueContains valueContains(String spec, Terser expected) {
        return valueContains(spec, expected, false);
    }

    public static TerserSpecificationValueContains valueContains(String spec, Terser expected, boolean useGenericMessage) {
        return new TerserSpecificationValueContains(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueMatchesPattern valueMatchesPattern(String spec, Pattern expected) {
        return valueMatchesPattern(spec, expected, false);
    }

    public static TerserSpecificationValueMatchesPattern valueMatchesPattern(String spec, Pattern expected, boolean useGenericMessage) {
        return new TerserSpecificationValueMatchesPattern(spec, useGenericMessage, expected);
    }

    public static TerserSpecificationValueMatchesPattern valueMatchesPattern(String spec, String expected) {
        return valueMatchesPattern(spec, expected, false);
    }

    public static TerserSpecificationValueMatchesPattern valueMatchesPattern(String spec, String expected, boolean useGenericMessage) {
        return new TerserSpecificationValueMatchesPattern(spec, useGenericMessage, expected);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy