@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }
@SuppressWarnings("unchecked") public AnnotationBuilder add(String key, AnnotationBuilder val) { if (null == val) return this; AnnotationEntry ae = find(key); if (null == ae) { doAdd(key, val); } else { List<AnnotationBuilder> list; if (ae.value instanceof List) { list = (List<AnnotationBuilder>) ae.value; } else if (ae.value instanceof AnnotationBuilder) { list = new ArrayList<AnnotationBuilder> (); list.add((AnnotationBuilder) ae.value); ae.value = list; } else { throw new IllegalArgumentException( "Unexpected type: " + ae.value); } list.add(val); } return this; }