Use @Serial tag
[mdsal.git] / singleton-service / mdsal-singleton-common-api / src / main / java / org / opendaylight / mdsal / singleton / common / api / ServiceGroupIdentifier.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.mdsal.singleton.common.api;
9
10 import java.io.Serial;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.util.AbstractStringIdentifier;
13
14 /**
15  * Identifier represents a service group competence. It's based on String.
16  */
17 public class ServiceGroupIdentifier extends AbstractStringIdentifier<ServiceGroupIdentifier> {
18     @Serial
19     private static final long serialVersionUID = 6853612584804702662L;
20
21     protected ServiceGroupIdentifier(final @NonNull String string) {
22         super(string);
23     }
24
25     /**
26      * Method to create immutable instances of {@link ServiceGroupIdentifier}.
27      *
28      * @param name the String identifier for the ServiceGroupIdentifier instance
29      * @return {@link ServiceGroupIdentifier} new instance
30      */
31     public static @NonNull ServiceGroupIdentifier create(final String name) {
32         return new ServiceGroupIdentifier(name);
33     }
34
35     public final @NonNull String getName() {
36         return getValue();
37     }
38 }