1 package xuml.tools.model.compiler; 2 3 import java.util.Arrays; 4 import java.util.List; 5 6 import com.google.common.collect.Lists; 7 8 public class Type { 9 private final String base; 10 private final List<Type> generics; 11 private final boolean isArray; 12 13 public Type(String base, List<Type> generics, boolean isArray) { 14 super(); 15 this.base = base; 16 if (generics != null) 17 this.generics = generics; 18 else 19 this.generics = Lists.newArrayList(); 20 this.isArray = isArray; 21 } 22 23 public Type./../../../xuml/tools/model/compiler/Type.html#Type">Type(String base, Type generic) { 24 this(base, Arrays.asList(new Type[] { generic }), false); 25 } 26 27 public Type(Class<?> cls) { 28 this(cls.getName(), null, false); 29 } 30 31 public Type(Class<?> cls, boolean isArray) { 32 this(cls.getName(), null, isArray); 33 } 34 35 public Type(Class<?> cls, Type... generic) { 36 this(cls.getName(), Arrays.asList(generic), false); 37 } 38 39 public Type(String base) { 40 this(base, null, false); 41 } 42 43 public String getBase() { 44 return base; 45 } 46 47 public List<Type> getGenerics() { 48 return generics; 49 } 50 51 public boolean isArray() { 52 return isArray; 53 } 54 }