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

org.beandiff.core.CompositeDescendingStrategy.scala Maven / Gradle / Ivy

/**
 * Copyright (c) 2012-2013, Tomasz Kaczmarzyk.
 *
 * This file is part of BeanDiff.
 *
 * BeanDiff is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * BeanDiff is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with BeanDiff; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
package org.beandiff.core

import org.beandiff.core.model.Path

object CompositeDescendingStrategy {

  def allOf(strategy: DescendingStrategy, strategies: DescendingStrategy*) = {
    val allStrategies = strategy +: strategies
    new DescendingStrategy {
      override def shouldProceed(path: Path, obj1: Any, obj2: Any) = {
        allStrategies.forall(_.shouldProceed(path, obj1, obj2))
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy