/** * Adds a layer. Removes any prior occurrences of the same layer. * * <p>Note that only subclasses of {@link Layer} that implement {@code equals/hashCode} will be * guaranteed to not be duplicated. * * @param layer the layer to add * @return this * @throws LayerPropertyNotFoundException if adding the layer fails */ public Builder Add(ILayer layer) { layer = layer ?? throw new ArgumentNullException(nameof(layer)); layerDigestsBuilder.Add(layer.GetBlobDescriptor().GetDigest()); layers.Add(layer); return(this); }