@Test public void testSet() { String[] values = null; Metadata meta = new Metadata(); values = meta.getValues(CONTENTTYPE); assertEquals(0, values.length); meta.set(CONTENTTYPE, "value1"); values = meta.getValues(CONTENTTYPE); assertEquals(1, values.length); assertEquals("value1", values[0]); meta.set(CONTENTTYPE, "value2"); values = meta.getValues(CONTENTTYPE); assertEquals(1, values.length); assertEquals("value2", values[0]); meta.set(CONTENTTYPE, "new value 1"); meta.add("contenttype", "new value 2"); values = meta.getValues(CONTENTTYPE); assertEquals(2, values.length); assertEquals("new value 1", values[0]); assertEquals("new value 2", values[1]); }
public void set(String name, String value) { if (value != null) { metadata.put(name, new String[] { value }); } else { metadata.remove(name); } }
Metadata implements CreativeCommons, Geographic, HttpHeaders,
        Message, ClimateForcast, TIFF, TikaMimeKeys,
        Serializable { public void set(String name, String value) { if (value != null) { metadata.put(name, new String[] { value }); } else { metadata.remove(name); } } }
Metadata implements CreativeCommons, Geographic, HttpHeaders,
        Message, ClimateForcast, TIFF, TikaMimeKeys,
        Serializable { public void set(String name, String value) { if (value != null) { metadata.put(name, new String[] { value }); } else { metadata.remove(name); } } Metadata(); }
Metadata implements CreativeCommons, Geographic, HttpHeaders,
        Message, ClimateForcast, TIFF, TikaMimeKeys,
        Serializable { public void set(String name, String value) { if (value != null) { metadata.put(name, new String[] { value }); } else { metadata.remove(name); } } Metadata(); boolean isMultiValued(final Property property); boolean isMultiValued(final String name); String[] names(); String get(final String name); String get(Property property); Integer getInt(Property property); Date getDate(Property property); String[] getValues(final Property property); String[] getValues(final String name); void add(final String name, final String value); void add(final Property property, final String value); @SuppressWarnings("unchecked") void setAll(Properties properties); void set(String name, String value); void set(Property property, String value); void set(Property property, String[] values); void set(Property property, int value); void add(Property property, int value); int[] getIntValues(Property property); void set(Property property, double value); void set(Property property, Date date); void set(Property property, Calendar date); void remove(String name); int size(); int hashCode(); boolean equals(Object o); String toString(); }
Metadata implements CreativeCommons, Geographic, HttpHeaders,
        Message, ClimateForcast, TIFF, TikaMimeKeys,
        Serializable { public void set(String name, String value) { if (value != null) { metadata.put(name, new String[] { value }); } else { metadata.remove(name); } } Metadata(); boolean isMultiValued(final Property property); boolean isMultiValued(final String name); String[] names(); String get(final String name); String get(Property property); Integer getInt(Property property); Date getDate(Property property); String[] getValues(final Property property); String[] getValues(final String name); void add(final String name, final String value); void add(final Property property, final String value); @SuppressWarnings("unchecked") void setAll(Properties properties); void set(String name, String value); void set(Property property, String value); void set(Property property, String[] values); void set(Property property, int value); void add(Property property, int value); int[] getIntValues(Property property); void set(Property property, double value); void set(Property property, Date date); void set(Property property, Calendar date); void remove(String name); int size(); int hashCode(); boolean equals(Object o); String toString();  }