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

com.github.dakusui.crest.matcherbuilders.AsString Maven / Gradle / Ivy

package com.github.dakusui.crest.matcherbuilders;

import com.github.dakusui.crest.utils.printable.Predicates;

import java.util.Objects;
import java.util.function.Function;

public class AsString extends AsComparable> {
  public AsString(Function function) {
    super(function);
  }

  public AsString matchesRegex(String regex) {
    return this.check(Predicates.matchesRegex(Objects.requireNonNull(regex)));
  }

  public AsString containsString(String string) {
    return this.check(Predicates.containsString(Objects.requireNonNull(string)));

  }

  public AsString startsWith(String s) {
    return this.check(Predicates.startsWith(Objects.requireNonNull(s)));
  }

  public AsString endsWith(String s) {
    return this.check(Predicates.endsWith(Objects.requireNonNull(s)));
  }

  public AsString equalsIgnoreCase(String s) {
    return this.check(Predicates.equalsIgnoreCase(Objects.requireNonNull(s)));
  }

  public AsString isEmpty() {
    return this.check(Predicates.isEmptyString());
  }

  public AsString isEmptyOrNull() {
    return this.check(Predicates.isEmptyOrNullString());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy