Add IOMv1 proxy
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / OIOMv1.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 com.google.common.collect.ImmutableList;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.util.ImmutableOffsetMap.Ordered;
13
14 /**
15  * Serialization proxy for {@link Ordered}.
16  */
17 final class OIOMv1 extends IOMv1<Ordered<?, ?>> {
18     private static final long serialVersionUID = 1;
19
20     @SuppressWarnings("checkstyle:RedundantModifier")
21     public OIOMv1() {
22         // For Externalizable
23     }
24
25     OIOMv1(final @NonNull Ordered<?, ?> map) {
26         super(map);
27     }
28
29     @Override
30     Ordered<?, ?> readReplace(final ImmutableList<Object> keys, final Object[] values) {
31         return new Ordered<>(OffsetMapCache.orderedOffsets(keys), values);
32     }
33 }