+ return headerName;
+ }
+
+ /** Get the value from either a {@link Manifest} or a {@link Properties}. */
+ String get(Object map) {
+ if (map instanceof Manifest manifest)
+ return manifest.getMainAttributes().getValue(headerName);
+ else if (map instanceof Properties props)
+ return props.getProperty(headerName);
+ else
+ throw new IllegalArgumentException("Unsupported mapping " + map.getClass());
+ }
+
+ /** Put the value into either a {@link Manifest} or a {@link Properties}. */
+ void put(Object map, String value) {
+ if (map instanceof Manifest manifest)
+ manifest.getMainAttributes().putValue(headerName, value);
+ else if (map instanceof Properties props)
+ props.setProperty(headerName, value);
+ else
+ throw new IllegalArgumentException("Unsupported mapping " + map.getClass());