Coverage Report - org.mule.transport.NullPayload
 
Classes in this File Line Coverage Branch Coverage Complexity
NullPayload
88%
7/8
N/A
1
NullPayload$1
N/A
N/A
1
NullPayload$NullPayloadHolder
100%
2/2
N/A
1
 
 1  
 /*
 2  
  * $Id: NullPayload.java 10489 2008-01-23 17:53:38Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.transport;
 12  
 
 13  
 import java.io.ObjectStreamException;
 14  
 import java.io.Serializable;
 15  
 
 16  
 /**
 17  
  * <code>NullPayload</code> represents a null event payload
 18  
  */
 19  
 // @Immutable
 20  2
 public final class NullPayload implements Serializable
 21  
 {
 22  
     /**
 23  
      * Serial version
 24  
      */
 25  
     private static final long serialVersionUID = 3530905899811505080L;
 26  
 
 27  56
     private static class NullPayloadHolder
 28  
     {
 29  2
         private static final NullPayload instance = new NullPayload();
 30  
     }
 31  
 
 32  
     public static NullPayload getInstance()
 33  
     {
 34  54
         return NullPayloadHolder.instance;
 35  
     }
 36  
 
 37  
     private NullPayload()
 38  
     {
 39  2
         super();
 40  2
     }
 41  
 
 42  
     private Object readResolve() throws ObjectStreamException
 43  
     {
 44  2
         return NullPayloadHolder.instance;
 45  
     }
 46  
 
 47  
     // @Override
 48  
     public boolean equals(Object obj)
 49  
     {
 50  4
         return obj instanceof NullPayload;
 51  
     }
 52  
 
 53  
     // @Override
 54  
     public int hashCode ()
 55  
     {
 56  0
         return 1; // random, 0 is taken by VoidResult
 57  
     }
 58  
 
 59  
     // @Override
 60  
     public String toString()
 61  
     {
 62  4
         return "{NullPayload}";
 63  
     }
 64  
 
 65  
 }