Add SSv1
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / SSv1.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, 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.util;
9
10 import java.io.Serializable;
11
12 /**
13  * Serialization proxy for {@link SingletonSet}.
14  */
15 final class SSv1 implements Serializable {
16     private static final long serialVersionUID = 1;
17
18     private final Object element;
19
20     SSv1(final Object element) {
21         this.element = element;
22     }
23
24     private Object readResolve() {
25         return SingletonSet.of(element);
26     }
27 }