Use @Serial in util
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / AbstractUUIDIdentifier.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.Serial;
11 import java.util.UUID;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Identifier;
14
15 /**
16  * Utility {@link Identifier} backed by a {@link UUID}.
17  */
18 public abstract class AbstractUUIDIdentifier<T extends AbstractUUIDIdentifier<T>> extends AbstractIdentifier<UUID>
19         implements Comparable<T> {
20     @Serial
21     private static final long serialVersionUID = 1L;
22
23     protected AbstractUUIDIdentifier(final @NonNull UUID uuid) {
24         super(uuid);
25     }
26
27     @Override
28     @SuppressWarnings("checkstyle:parameterName")
29     public final int compareTo(final T o) {
30         return getValue().compareTo(o.getValue());
31     }
32 }