- public «type.name» add«AUGMENTATION_FIELD_UPPER»(«jlClassRef»<? extends «augmentTypeRef»> augmentationType, «augmentTypeRef» augmentationValue) {
- if (augmentationValue == null) {
- return remove«AUGMENTATION_FIELD_UPPER»(augmentationType);
+ /**
+ * Add or remove an augmentation to this builder's product.
+ *
+ * @param augmentationType augmentation type to be added or removed
+ * @param augmentationValue augmentation value, null if the augmentation type should be removed
+ * @return this builder
+ * @deprecated Use either {@link #addAugmentation(«augmentType.importedJavadocName»)} or {@link #removeAugmentation(«CLASS.importedName»)} instead.
+ */
+ @«DEPRECATED.importedName»
+ public «type.name» addAugmentation(«jlClassRef»<? extends «augmentTypeRef»> augmentationType, «augmentTypeRef» augmentationValue) {
+ return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue);
+ }
+
+ /**
+ * Remove an augmentation from this builder's product. If this builder does not track such an augmentation
+ * type, this method does nothing.
+ *
+ * @param augmentationType augmentation type to be removed
+ * @return this builder
+ */
+ public «type.name» removeAugmentation(«jlClassRef»<? extends «augmentTypeRef»> augmentationType) {
+ if (this.«AUGMENTATION_FIELD» instanceof «hashMapRef») {
+ this.«AUGMENTATION_FIELD».remove(augmentationType);