Coverage Report - org.mule.transport.xmpp.filters.XmppPacketTypeFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
XmppPacketTypeFilter
0%
0/14
0%
0/6
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.transport.xmpp.filters;
 8  
 
 9  
 import org.mule.util.ClassUtils;
 10  
 
 11  
 import org.jivesoftware.smack.filter.PacketFilter;
 12  
 
 13  
 /**
 14  
  * <code>XmppPacketTypeFilter</code> is an Xmpp PacketTypeFilter adapter.
 15  
  */
 16  
 public class XmppPacketTypeFilter extends AbstractXmppFilter
 17  
 {
 18  
     private volatile Class<?> expectedType;
 19  
 
 20  
     public XmppPacketTypeFilter()
 21  
     {
 22  0
         super();
 23  0
     }
 24  
 
 25  
     public XmppPacketTypeFilter(Class<?> expectedType)
 26  0
     {
 27  0
         setExpectedType(expectedType);
 28  0
     }
 29  
 
 30  
     public Class<?> getExpectedType()
 31  
     {
 32  0
         return expectedType;
 33  
     }
 34  
 
 35  
     public void setExpectedType(Class<?> expectedType)
 36  
     {
 37  0
         this.expectedType = expectedType;
 38  0
     }
 39  
 
 40  
     @Override
 41  
     protected PacketFilter createFilter()
 42  
     {
 43  0
         return new org.jivesoftware.smack.filter.PacketTypeFilter(expectedType);
 44  
     }
 45  
     
 46  
     @Override
 47  
     public boolean equals(Object obj)
 48  
     {
 49  0
         if (this == obj) return true;
 50  0
         if (obj == null || getClass() != obj.getClass()) return false;
 51  
 
 52  0
         XmppPacketTypeFilter other = (XmppPacketTypeFilter) obj;
 53  0
         return ClassUtils.equal(expectedType, other.expectedType);
 54  
     }
 55  
 
 56  
     @Override
 57  
     public int hashCode()
 58  
     {
 59  0
         return ClassUtils.hash(new Object[]{this.getClass(), expectedType});
 60  
     }
 61  
 }