Remove hashCode()/equals() from SchemaNode implementations
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / deviation / DeviationEffectiveStatementImpl.java
1 /*
2  * Copyright (c) 2015 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.yangtools.yang.parser.rfc7950.stmt.deviation;
9
10 import com.google.common.collect.ImmutableList;
11 import java.util.List;
12 import org.opendaylight.yangtools.yang.model.api.DeviateDefinition;
13 import org.opendaylight.yangtools.yang.model.api.Deviation;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
15 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.DeviationEffectiveStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.DeviationStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
19 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractDeclaredEffectiveStatement.DefaultArgument.WithSubstatements;
20 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.EffectiveStatementMixins.DocumentedNodeMixin;
21
22 final class DeviationEffectiveStatementImpl extends WithSubstatements<SchemaNodeIdentifier, DeviationStatement>
23         implements DeviationEffectiveStatement, Deviation,
24             DocumentedNodeMixin<SchemaNodeIdentifier, DeviationStatement> {
25     DeviationEffectiveStatementImpl(final DeviationStatement declared,
26             final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
27         super(declared, substatements);
28     }
29
30     @Override
31     public SchemaPath getTargetPath() {
32         return argument().asSchemaPath();
33     }
34
35     @Override
36     public List<DeviateDefinition> getDeviates() {
37         return filterEffectiveStatementsList(DeviateDefinition.class);
38     }
39
40     @Override
41     public String toString() {
42         return DeviationEffectiveStatementImpl.class.getSimpleName() + "["
43                 + "targetPath=" + getTargetPath()
44                 + ", deviates=" + getDeviates()
45                 + ", description=" + getDescription().orElse(null)
46                 + ", reference=" + getReference().orElse(null)
47                 + "]";
48     }
49 }