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

com.github.tonivade.purefun.Matcher2 Maven / Gradle / Ivy

/*
 * Copyright (c) 2018-2019, Antonio Gabriel Muñoz Conejo 
 * Distributed under the terms of the MIT License
 */
package com.github.tonivade.purefun;

@FunctionalInterface
public interface Matcher2 {

  boolean match(A a, B b);

  default Matcher1> tupled() {
    return tuple -> match(tuple.get1(), tuple.get2());
  }

  static  Matcher2 invalid() {
    return (a, b) -> { throw new IllegalStateException(); };
  }

  static  Matcher2 otherwise() {
    return (a, b) -> true;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy