Class PropertyCollection

  • All Implemented Interfaces:
    AutoCloseable

    public class PropertyCollection
    extends Object
    implements AutoCloseable
    Represents collection of properties and their values. Note: close() must be called in order to release underlying resources held by the object.
    • Constructor Detail

      • PropertyCollection

        public PropertyCollection​(IntRef propHandle)
        Creates a new instance or PropertyCollection using the provided native handle.
        Parameters:
        propHandle - The native handle.
    • Method Detail

      • getProperty

        public String getProperty​(String name)
        Returns the property value. If the name is not available, it returns an empty String.
        Parameters:
        name - The property name.
        Returns:
        value of the property.
      • getProperty

        public String getProperty​(String name,
                                  String defaultValue)
        Returns the property value. If the name is not available, it returns a default value.
        Parameters:
        name - The property name.
        defaultValue - The default value which is returned if the property is not available in the collection.
        Returns:
        value of the property.
      • getProperty

        public String getProperty​(PropertyId id)
        Gets the property's value by its id
        Parameters:
        id - The speech property id
        Returns:
        The value of the property.
      • setProperty

        public void setProperty​(String name,
                                String value)
        Sets the property value by name
        Parameters:
        name - The property name.
        value - The value of the property.
      • setProperty

        public void setProperty​(PropertyId id,
                                String value)
        Sets the property's value by id
        Parameters:
        id - The property id
        value - The value of the parameter.
      • close

        public void close()
        Dispose of the associated parameter value collection.
        Specified by:
        close in interface AutoCloseable