Use @Serial tag
[mdsal.git] / singleton-service / mdsal-singleton-dom-impl / src / test / java / org / opendaylight / mdsal / singleton / dom / impl / util / TestEntity.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.dom.impl.util;
9
10 import java.io.Serial;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.eos.common.api.GenericEntity;
13 import org.opendaylight.yangtools.yang.common.QName;
14
15 /**
16  * Test util class.
17  */
18 public class TestEntity extends GenericEntity<TestInstanceIdentifier> {
19     @Serial
20     private static final long serialVersionUID = 1L;
21
22     static final QName ENTITY = QName
23             .create("urn:opendaylight:params:xml:ns:yang:mdsal:core:test-entity", "2016-06-06", "entity").intern();
24     static final QName ENTITY_NAME = QName.create(ENTITY, "name").intern();
25
26     /** Constructs an instance.
27      *
28      * @param type the entity type
29      * @param id the entity id.
30      */
31     public TestEntity(final @NonNull String type, final @NonNull TestInstanceIdentifier id) {
32         super(type, id);
33     }
34
35     /**
36      * Construct an Entity with an with a name. The general-entity schema is used to construct the
37      * {@link TestInstanceIdentifier}.
38      *
39      * @param type the type of the entity
40      * @param entityName the name of the entity used to construct a general-entity YangInstanceIdentifier
41      */
42     public TestEntity(final @NonNull String type, final @NonNull String entityName) {
43         super(type, new TestInstanceIdentifier(entityName));
44     }
45 }