Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-common / src / main / java / org / opendaylight / yangtools / yang / common / Empty.java
1 /*
2  * Copyright (c) 2015 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.common;
9
10 import com.google.common.annotations.Beta;
11 import java.io.Serializable;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.yangtools.concepts.Immutable;
14
15 /**
16  * Dedicated singleton type for YANG's 'type empty' value.
17  *
18  * @author Robert Varga
19  */
20 @Beta
21 @NonNullByDefault
22 public final class Empty implements Immutable, Serializable {
23     private static final long serialVersionUID = 1L;
24     private static final Empty INSTANCE = new Empty();
25
26     private Empty() {
27
28     }
29
30     public static Empty getInstance() {
31         return INSTANCE;
32     }
33
34     @Override
35     public String toString() {
36         return "empty";
37     }
38
39     @SuppressWarnings("static-method")
40     private Object readResolve() {
41         return INSTANCE;
42     }
43 }