PropertyCollection Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.PropertyCollection

Implements

java.lang.AutoCloseable

public class PropertyCollection
implements java.lang.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

Constructor Description
PropertyCollection(IntRef propHandle)

Creates a new instance or PropertyCollection using the provided native handle.

Method Summary

Modifier and Type Method and Description
void close()

Dispose of the associated parameter value collection.

java.lang.String getProperty(PropertyId id)

Gets the property's value by its id

java.lang.String getProperty(String name)

Returns the property value.

java.lang.String getProperty(String name, String defaultValue)

Returns the property value.

void setProperty(PropertyId id, String value)

Sets the property's value by id

void setProperty(String name, String value)

Sets the property value by name

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

PropertyCollection

public PropertyCollection(IntRef propHandle)

Creates a new instance or PropertyCollection using the provided native handle.

Parameters:

propHandle - The native handle.

Method Details

close

public void close()

Dispose of the associated parameter value collection.

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.

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.

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.

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.

Applies to