Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 1 | package aQute.bnd.compatibility; |
| 2 | |
| 3 | public class GenericParameter { |
| 4 | String name; |
| 5 | GenericType bounds[]; |
| 6 | |
| 7 | public GenericParameter(String name, GenericType[] bounds) { |
| 8 | this.name = name; |
| 9 | this.bounds = bounds; |
| 10 | if (bounds == null || bounds.length == 0) |
| 11 | this.bounds = new GenericType[] { new GenericType( Object.class) }; |
| 12 | } |
| 13 | |
| 14 | public String toString() { |
| 15 | StringBuilder sb = new StringBuilder(); |
| 16 | sb.append(name); |
| 17 | if ( bounds != null && bounds.length > 0) { |
| 18 | for ( GenericType gtype : bounds ) { |
| 19 | sb.append( ":"); |
| 20 | sb.append(gtype); |
| 21 | } |
| 22 | } |
| 23 | return sb.toString(); |
| 24 | } |
| 25 | } |