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 com.google.common.base.Preconditions;
11 import java.util.List;
13 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
15 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
18 final class BaseIdentityrefType extends AbstractBaseType<IdentityrefTypeDefinition>
19 implements IdentityrefTypeDefinition {
20 private final IdentitySchemaNode identity;
21 private final Set<IdentitySchemaNode> identities;
23 BaseIdentityrefType(final SchemaPath path, final List<UnknownSchemaNode> unknownSchemaNodes,
24 final IdentitySchemaNode identity, final Set<IdentitySchemaNode> identities) {
25 super(path, unknownSchemaNodes);
26 this.identity = Preconditions.checkNotNull(identity);
27 this.identities = Preconditions.checkNotNull(identities);
31 public IdentitySchemaNode getIdentity() {
36 public Set<IdentitySchemaNode> getIdentities() {
41 public int hashCode() {
42 return TypeDefinitions.hashCode(this);
46 public boolean equals(final Object obj) {
47 return TypeDefinitions.equals(this, obj);
51 public String toString() {
52 return TypeDefinitions.toString(this);