Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NullPayload |
|
| 1.0;1 | ||||
NullPayload$1 |
|
| 1.0;1 | ||||
NullPayload$NullPayloadHolder |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: NullPayload.java 7976 2007-08-21 14:26:13Z dirk.olmes $ | |
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.providers; | |
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 | 0 | public final class NullPayload implements Serializable |
21 | { | |
22 | /** | |
23 | * Serial version | |
24 | */ | |
25 | private static final long serialVersionUID = 3530905899811505080L; | |
26 | ||
27 | 0 | private static class NullPayloadHolder |
28 | { | |
29 | 0 | private static final NullPayload instance = new NullPayload(); |
30 | } | |
31 | ||
32 | public static NullPayload getInstance() | |
33 | { | |
34 | 0 | return NullPayloadHolder.instance; |
35 | } | |
36 | ||
37 | private NullPayload() | |
38 | { | |
39 | 0 | super(); |
40 | 0 | } |
41 | ||
42 | private Object readResolve() throws ObjectStreamException | |
43 | { | |
44 | 0 | return NullPayloadHolder.instance; |
45 | } | |
46 | ||
47 | // @Override | |
48 | public boolean equals(Object obj) | |
49 | { | |
50 | 0 | 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 | 0 | return "{NullPayload}"; |
63 | } | |
64 | ||
65 | } |