Class PropertyCollection
- java.lang.Object
-
- com.azure.android.ai.vision.common.PropertyCollection
-
- All Implemented Interfaces:
AutoCloseable
public final 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(SafeHandle propHandle)
Internal constructor for PropertyCollection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Dispose of the associated parameter value collection.SafeHandle
getHandle()
Gets the property collection handleString
getProperty(String propertyName)
Returns the property value.String
getProperty(String propertyName, String defaultValue)
Returns the property value.byte[]
getPropertyBinary(String propertyName)
Returns the binary property value.void
setProperty(String propertyName, String value)
Sets the property value by name
-
-
-
Constructor Detail
-
PropertyCollection
public PropertyCollection(SafeHandle propHandle)
Internal constructor for PropertyCollection- Parameters:
propHandle
- the native handle to the property collection
-
-
Method Detail
-
getProperty
public String getProperty(String propertyName)
Returns the property value. If the name is not available, it returns a default value.- Parameters:
propertyName
- The property name.- Returns:
- Value of the property.
-
getPropertyBinary
public byte[] getPropertyBinary(String propertyName)
Returns the binary property value. If the name is not available, it returns null.- Parameters:
propertyName
- The property name.- Returns:
- Value of the property.
-
getProperty
public String getProperty(String propertyName, String defaultValue)
Returns the property value. If the name is not available, it returns a default value.- Parameters:
propertyName
- 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(String propertyName, String value)
Sets the property value by name- Parameters:
propertyName
- The property name.value
- The value of the property.
-
close
public void close()
Dispose of the associated parameter value collection.- Specified by:
close
in interfaceAutoCloseable
-
getHandle
public SafeHandle getHandle()
Gets the property collection handle- Returns:
- The property collection handle
-
-