2 * Copyright (c) 2015 Pantheon Technologies s.r.o. 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.yangtools.yang.model.ri.type;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Collection;
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
17 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
20 final class BaseIdentityrefType extends AbstractBaseType<IdentityrefTypeDefinition>
21 implements IdentityrefTypeDefinition {
22 private final @NonNull Set<? extends IdentitySchemaNode> identities;
24 BaseIdentityrefType(final QName qname, final Collection<? extends UnknownSchemaNode> unknownSchemaNodes,
25 final Set<? extends IdentitySchemaNode> identities) {
26 super(qname, unknownSchemaNodes);
27 this.identities = requireNonNull(identities);
31 public Set<? extends IdentitySchemaNode> getIdentities() {
36 public int hashCode() {
37 return IdentityrefTypeDefinition.hashCode(this);
41 public boolean equals(final Object obj) {
42 return IdentityrefTypeDefinition.equals(this, obj);
46 public String toString() {
47 return IdentityrefTypeDefinition.toString(this);