/** * Fill a builder with attribute values from the provided {@code AcquisitionMethod} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final AcquisitionMethod.Builder createFrom(AcquisitionMethod instance) { Objects.requireNonNull(instance, "instance"); String descriptionValue = instance.getDescription(); if (descriptionValue != null) { description(descriptionValue); } String iconValue = instance.getIcon(); if (iconValue != null) { icon(iconValue); } String labelValue = instance.getLabel(); if (labelValue != null) { label(labelValue); } Type typeValue = instance.getType(); if (typeValue != null) { type(typeValue); } return (AcquisitionMethod.Builder) this; }