621b7185c6e91a9b9e2d77ddfed25939f60d415c
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / util / AbstractDocumentedNode.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.yangtools.yang.parser.builder.util;
10
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
13 import org.opendaylight.yangtools.yang.model.api.Status;
14
15 public abstract class AbstractDocumentedNode implements DocumentedNode {
16
17     private final String description;
18     private final String reference;
19     private final Status status;
20
21     AbstractDocumentedNode(final AbstractDocumentedNodeBuilder builder) {
22         Preconditions.checkArgument(builder.isSealed(), "Builder must be sealed.");
23         this.description = builder.getDescription();
24         this.reference = builder.getReference();
25         this.status = builder.getStatus();
26     }
27
28     @Override
29     public final String getDescription() {
30         return description;
31     }
32
33     @Override
34     public final String getReference() {
35         return reference;
36     }
37
38     @Override
39     public final Status getStatus() {
40         return status;
41     }
42
43 }