/** * Add a metadata entry with the given name. * * Metadata item names are treated as case-insensitive when you set/get values. * If a name values being set matches an existing metdata item (even if * case is different) the original value will be replaced with the new one. * * The case of metadata item names is preserved when items are stored so the * original names are accessible via {@link #getMetadataMap()}, but case is * otherwise ignored. * * In other words, if you set two metadata items with the names "ETag" and "Etag" * only one value will be stored, whichever was set most recently. * * @param name * the metadata item name, case-insensitive. * @param value * the metadata item value. */ protected void addMetadata(String name, Object value) { this.removeMetadata(name); this.metadata.put(name, value); }
/** * Add a metadata entry with the given name. * * Metadata item names are treated as case-insensitive when you set/get values. * If a name values being set matches an existing metdata item (even if * case is different) the original value will be replaced with the new one. * * The case of metadata item names is preserved when items are stored so the * original names are accessible via {@link #getMetadataMap()}, but case is * otherwise ignored. * * In other words, if you set two metadata items with the names "ETag" and "Etag" * only one value will be stored, whichever was set most recently. * * @param name * the metadata item name, case-insensitive. * @param value * the metadata item value. */ protected void addMetadata(String name, Object value) { this.removeMetadata(name); this.metadata.put(name, value); }