blob: e801a8ae389d0595720642a09da886839d44ce22 [file] [log] [blame]
Stuart McCullochbb014372012-06-07 21:57:32 +00001package aQute.bnd.compatibility;
2
3public class GenericParameter {
Stuart McCulloch2286f232012-06-15 13:27:53 +00004 String name;
5 GenericType bounds[];
6
Stuart McCullochbb014372012-06-07 21:57:32 +00007 public GenericParameter(String name, GenericType[] bounds) {
8 this.name = name;
9 this.bounds = bounds;
10 if (bounds == null || bounds.length == 0)
Stuart McCulloch2286f232012-06-15 13:27:53 +000011 this.bounds = new GenericType[] {
12 new GenericType(Object.class)
13 };
Stuart McCullochbb014372012-06-07 21:57:32 +000014 }
15
Stuart McCulloch55d4dfe2012-08-07 10:57:21 +000016 @Override
Stuart McCullochbb014372012-06-07 21:57:32 +000017 public String toString() {
18 StringBuilder sb = new StringBuilder();
19 sb.append(name);
Stuart McCulloch2286f232012-06-15 13:27:53 +000020 if (bounds != null && bounds.length > 0) {
21 for (GenericType gtype : bounds) {
22 sb.append(":");
Stuart McCullochbb014372012-06-07 21:57:32 +000023 sb.append(gtype);
24 }
25 }
26 return sb.toString();
27 }
28}