*/
package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
-import com.google.common.collect.Lists;
+import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.common.collect.Lists;
import java.util.List;
public class Field {
}
public Field(List<String> modifiers, String type, String name,
- String definition, boolean needsDepResolver) {
- this.modifiers = modifiers;
- this.type = type;
- this.name = name;
- this.definition = definition;
+ String nullableDefinition, boolean needsDepResolver) {
+ this.modifiers = checkNotNull(modifiers);
+ this.type = checkNotNull(type);
+ this.name = checkNotNull(name);
+ this.definition = nullableDefinition;
this.needsDepResolver = needsDepResolver;
}
return type;
}
+ public String getGenericInnerType() {
+ return type.substring(type.indexOf("<") + 1, type.indexOf(">"));
+ }
+
public List<String> getModifiers() {
return modifiers;
}
public boolean isArray() {
return type.endsWith("[]");
}
+
+ @Override
+ public String toString() {
+ return FieldSerializer.toString(this);
+ }
}