2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.eos.dom.api;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.mdsal.eos.common.api.GenericEntity;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 * Binding version of {@link GenericEntity}.
21 * @author Thomas Pantelis
24 public class DOMEntity extends GenericEntity<YangInstanceIdentifier> {
25 private static final long serialVersionUID = 1L;
27 static final QName ENTITY = QName.create(
28 "urn:opendaylight:params:xml:ns:yang:mdsal:core:general-entity", "2015-09-30", "entity").intern();
29 static final QName ENTITY_NAME = QName.create(ENTITY, "name").intern();
31 /** Constructs an instance.
33 * @param type the entity type
34 * @param id the entity id.
36 public DOMEntity(final @NonNull String type, final @NonNull YangInstanceIdentifier id) {
41 * Construct an Entity with an with a name. The general-entity schema is used to construct the
42 * YangInstanceIdentifier.
44 * @param type the type of the entity
45 * @param entityName the name of the entity used to construct a general-entity YangInstanceIdentifier
47 public DOMEntity(final @NonNull String type, final @NonNull String entityName) {
48 super(type, YangInstanceIdentifier.builder().node(ENTITY).nodeWithKey(ENTITY, ENTITY_NAME,
49 requireNonNull(entityName, "entityName should not be null")).build());