org.mockserver.verify.VerificationTimes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
package org.mockserver.verify;
import org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString;
/**
* @author jamesdbloom
*/
public class VerificationTimes extends ObjectWithReflectiveEqualsHashCodeToString {
private final int count;
private final boolean exact;
private VerificationTimes(int count, boolean exact) {
this.count = count;
this.exact = exact;
}
public static VerificationTimes once() {
return new VerificationTimes(1, true);
}
public static VerificationTimes exactly(int count) {
return new VerificationTimes(count, true);
}
public static VerificationTimes atLeast(int count) {
return new VerificationTimes(count, false);
}
public int getCount() {
return count;
}
public boolean isExact() {
return exact;
}
public String toString() {
String string = "";
if (exact) {
string += "exactly ";
} else {
string += "at least ";
}
if (count == 1) {
string += "once";
} else {
string += count + " times";
}
return string;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy