Class Metadata

    • Constructor Detail

      • Metadata

        public Metadata()
        Constructs a new, empty metadata.
    • Method Detail

      • isMultiValued

        public boolean isMultiValued​(Property property)
        Returns true if named value is multivalued.
        Parameters:
        property - metadata property
        Returns:
        true is named value is multivalued, false if single value or null
      • isMultiValued

        public boolean isMultiValued​(String name)
        Returns true if named value is multivalued.
        Parameters:
        name - name of metadata
        Returns:
        true is named value is multivalued, false if single value or null
      • names

        public String[] names()
        Returns an array of the names contained in the metadata.
        Returns:
        Metadata names
      • get

        public String get​(String name)
        Get the value associated to a metadata name. If many values are assiociated to the specified name, then the first one is returned.
        Parameters:
        name - of the metadata.
        Returns:
        the value associated to the specified metadata name.
      • get

        public String get​(Property property)
        Returns the value (if any) of the identified metadata property.
        Parameters:
        property - property definition
        Returns:
        property value, or null if the property is not set
        Since:
        Apache Tika 0.7
      • getInt

        public Integer getInt​(Property property)
        Returns the value of the identified Integer based metadata property.
        Parameters:
        property - simple integer property definition
        Returns:
        property value as a Integer, or null if the property is not set, or not a valid Integer
        Since:
        Apache Tika 0.8
      • getDate

        public Date getDate​(Property property)
        Returns the value of the identified Date based metadata property.
        Parameters:
        property - simple date property definition
        Returns:
        property value as a Date, or null if the property is not set, or not a valid Date
        Since:
        Apache Tika 0.8
      • getValues

        public String[] getValues​(Property property)
        Get the values associated to a metadata name.
        Parameters:
        property - of the metadata.
        Returns:
        the values associated to a metadata name.
      • getValues

        public String[] getValues​(String name)
        Get the values associated to a metadata name.
        Parameters:
        name - of the metadata.
        Returns:
        the values associated to a metadata name.
      • add

        public void add​(String name,
                        String value)
        Add a metadata name/value mapping. Add the specified value to the list of values associated to the specified metadata name.
        Parameters:
        name - the metadata name.
        value - the metadata value.
      • add

        public void add​(Property property,
                        String value)
        Add a metadata property/value mapping. Add the specified value to the list of values associated to the specified metadata property.
        Parameters:
        property - the metadata property.
        value - the metadata value.
      • setAll

        public void setAll​(Properties properties)
        Copy All key-value pairs from properties.
        Parameters:
        properties - properties to copy from
      • set

        public void set​(String name,
                        String value)
        Set metadata name/value. Associate the specified value to the specified metadata name. If some previous values were associated to this name, they are removed. If the given value is null, then the metadata entry is removed.
        Parameters:
        name - the metadata name.
        value - the metadata value, or null
      • set

        public void set​(Property property,
                        String value)
        Sets the value of the identified metadata property.
        Parameters:
        property - property definition
        value - property value
        Since:
        Apache Tika 0.7
      • set

        public void set​(Property property,
                        String[] values)
        Sets the values of the identified metadata property.
        Parameters:
        property - property definition
        values - property values
        Since:
        Apache Tika 1.2
      • set

        public void set​(Property property,
                        int value)
        Sets the integer value of the identified metadata property.
        Parameters:
        property - simple integer property definition
        value - property value
        Since:
        Apache Tika 0.8
      • add

        public void add​(Property property,
                        int value)
        Adds the integer value of the identified metadata property.
        Parameters:
        property - seq integer property definition
        value - property value
        Since:
        Apache Tika 1.21
      • getIntValues

        public int[] getIntValues​(Property property)
        Gets the array of ints of the identified "seq" integer metadata property.
        Parameters:
        property - seq integer property definition
        Returns:
        array of ints
        Since:
        Apache Tika 1.21
      • set

        public void set​(Property property,
                        double value)
        Sets the real or rational value of the identified metadata property.
        Parameters:
        property - simple real or simple rational property definition
        value - property value
        Since:
        Apache Tika 0.8
      • set

        public void set​(Property property,
                        Date date)
        Sets the date value of the identified metadata property.
        Parameters:
        property - simple integer property definition
        date - property value
        Since:
        Apache Tika 0.8
      • set

        public void set​(Property property,
                        Calendar date)
        Sets the date value of the identified metadata property.
        Parameters:
        property - simple integer property definition
        date - property value
        Since:
        Apache Tika 0.8
      • remove

        public void remove​(String name)
        Remove a metadata and all its associated values.
        Parameters:
        name - metadata name to remove
      • size

        public int size()
        Returns the number of metadata names in this metadata.
        Returns:
        number of metadata names
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object