com.pronoia.hapi.hamcrest.SegmentMatchers 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.model.Segment;
import com.pronoia.hapi.hamcrest.segment.SegmentContains;
import com.pronoia.hapi.hamcrest.segment.SegmentEndsWith;
import com.pronoia.hapi.hamcrest.segment.SegmentIsEqual;
import com.pronoia.hapi.hamcrest.segment.SegmentMatchesPattern;
import com.pronoia.hapi.hamcrest.segment.SegmentStartsWith;
public final class SegmentMatchers {
private SegmentMatchers() {
}
public static SegmentIsEqual equalTo(Segment expected) {
return equalTo(expected, false);
}
public static SegmentIsEqual equalTo(Segment expected, boolean ignoreMshTimestamp) {
return new SegmentIsEqual(expected, ignoreMshTimestamp);
}
public static SegmentIsEqual equalTo(String expected) {
return equalTo(expected, false);
}
public static SegmentIsEqual equalTo(String expected, boolean ignoreMshTimestamp) {
return new SegmentIsEqual(expected, ignoreMshTimestamp);
}
public static SegmentStartsWith startsWith(String expected) {
return new SegmentStartsWith(expected);
}
public static SegmentEndsWith endsWith(String expected) {
return new SegmentEndsWith(expected);
}
public static SegmentContains contains(String expected) {
return new SegmentContains(expected);
}
public static SegmentMatchesPattern matchesPattern(String expected) {
return new SegmentMatchesPattern(expected);
}
public static SegmentMatchesPattern matchesPattern(Pattern expected) {
return new SegmentMatchesPattern(expected);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy