Class PropertyCollection
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.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 Summary
Constructors Constructor Description PropertyCollection(IntRef propHandle)Creates a new instance or PropertyCollection using the provided native handle.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Dispose of the associated parameter value collection.StringgetProperty(PropertyId id)Gets the property's value by its idStringgetProperty(String name)Returns the property value.StringgetProperty(String name, String defaultValue)Returns the property value.voidsetProperty(PropertyId id, String value)Sets the property's value by idvoidsetProperty(String name, String value)Sets the property value by name
-
-
-
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 idvalue- The value of the parameter.
-
close
public void close()
Dispose of the associated parameter value collection.- Specified by:
closein interfaceAutoCloseable
-
-