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.util.type;
10 import static java.util.Objects.requireNonNull;
12 import java.util.List;
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
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<IdentitySchemaNode> identities;
24 BaseIdentityrefType(final SchemaPath path, final List<UnknownSchemaNode> unknownSchemaNodes,
25 final Set<IdentitySchemaNode> identities) {
26 super(path, unknownSchemaNodes);
27 this.identities = requireNonNull(identities);
31 public Set<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);