0857ec6f8da64e16e64119d44d78834fd477cb9c
[controller.git] / opendaylight / config / yang-jmx-generator-plugin / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / plugin / ftl / model / Field.java
1 /*
2  * Copyright (c) 2013 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.controller.config.yangjmxgenerator.plugin.ftl.model;
9
10 import com.google.common.collect.Lists;
11
12 import java.util.List;
13
14 public class Field {
15     private final String type;
16     private final String name;
17     private final String definition;
18     private final List<String> modifiers;
19
20     public Field(String type, String name) {
21         this(Lists.<String> newArrayList(), type, name, null);
22     }
23
24     public Field(String type, String name, String definition) {
25         this(Lists.<String> newArrayList(), type, name, definition);
26     }
27
28     public Field(List<String> modifiers, String type, String name) {
29         this(modifiers, type, name, null);
30     }
31
32     public Field(List<String> modifiers, String type, String name,
33             String definition) {
34         this.modifiers = modifiers;
35         this.type = type;
36         this.name = name;
37         this.definition = definition;
38     }
39
40     public String getType() {
41         return type;
42     }
43
44     public List<String> getModifiers() {
45         return modifiers;
46     }
47
48     public String getName() {
49         return name;
50     }
51
52     public String getDefinition() {
53         return definition;
54     }
55
56     public boolean isArray() {
57         return type.endsWith("[]");
58     }
59 }