1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.classic.pattern;
15  
16  import java.util.HashMap;
17  import java.util.Map;
18  
19  import org.slf4j.Marker;
20  
21  import ch.qos.logback.classic.spi.ClassPackagingData;
22  
23  /**
24   * 
25   * @author Ceki Gulcu
26   */
27  public class Util {
28  
29      static Map<String, ClassPackagingData> cache = new HashMap<String, ClassPackagingData>();
30  
31      static public boolean match(Marker marker, Marker[] markerArray) {
32          if (markerArray == null) {
33              throw new IllegalArgumentException("markerArray should not be null");
34          }
35  
36          // System.out.println("event marker="+marker);
37  
38          final int size = markerArray.length;
39          for (int i = 0; i < size; i++) {
40              // System.out.println("other:"+markerArray[i]);
41  
42              if (marker.contains(markerArray[i])) {
43                  return true;
44              }
45          }
46          return false;
47      }
48  
49  }