---
title: "The Properties Class"
url: https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# The Properties Class

Parts of this page are for some programming languages only, and name them. For one language's text alone, see [C++](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/ruby.md), and [Swift](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/swift.md).

A Properties ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties.html), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties)) object, or *property set*, is a collection of properties. Each communicator has a property set, which its `getProperties` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Communicator_aeb1e43dec06e3e2698e12b8266c1f18d.html#aeb1e43dec06e3e2698e12b8266c1f18d), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Communicator.html#Ice_Communicator_getProperties_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Communicator.html#getProperties()), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Communicator.html#getproperties), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Communicator.html#Ice.Communicator.getProperties), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/communicator/getproperties())) method returns. You can also create a property set yourself, for example to configure a new communicator.

## Reading and Setting a Property

`getProperty` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a4f3232722e42f1ca3b5018ccc70ae7e9.html#a4f3232722e42f1ca3b5018ccc70ae7e9), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getProperty_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getProperty(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getproperty), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getProperty), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getproperty(_:))), `getPropertyAsInt` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_acb291d6c408c8c1299fcf9dcf147c4c1.html#acb291d6c408c8c1299fcf9dcf147c4c1), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertyAsInt_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertyAsInt(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyasint), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertyAsInt), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertyasint(_:))), and `getPropertyAsList` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a7cc9e3937856655d9fb91adafacbbfa9.html#a7cc9e3937856655d9fb91adafacbbfa9), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertyAsList_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertyAsList(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyaslist), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertyAsList), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertyaslist(_:))) read a property as a string, an integer, or a list of strings. Their `WithDefault` variants, `getPropertyWithDefault` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a13ab56dbfe617028524a773f8a2286b5.html#a13ab56dbfe617028524a773f8a2286b5), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertyWithDefault_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertyWithDefault(java.lang.String,java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertywithdefault), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertyWithDefault), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertywithdefault(key:value:))), `getPropertyAsIntWithDefault` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a738eaba9a7275739b5eda0b0f7824684.html#a738eaba9a7275739b5eda0b0f7824684), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertyAsIntWithDefault_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertyAsIntWithDefault(java.lang.String,int)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyasintwithdefault), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertyAsIntWithDefault), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertyasintwithdefault(key:value:))), and `getPropertyAsListWithDefault` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a42dc1c1ba4186a0d1b0f09e7dfc50ee8.html#a42dc1c1ba4186a0d1b0f09e7dfc50ee8), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertyAsListWithDefault_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertyAsListWithDefault(java.lang.String,java.lang.String[])), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertyaslistwithdefault), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertyAsListWithDefault), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertyaslistwithdefault(key:value:))), return the default you give for a property that is not set.

`setProperty` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a7175c5e5066e5a8a744cd3572018d40c.html#a7175c5e5066e5a8a744cd3572018d40c), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_setProperty_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#setProperty(java.lang.String,java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#setproperty), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.setProperty), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/setproperty(key:value:))) sets a property, and applies the [property validation](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview.md#property-validation) rules.

## Reading an Ice Property

An *Ice property* is a property that Ice defines, such as `Ice.Warn.Dispatch`: its name begins with a [reserved prefix](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview.md#reserved-prefixes), and the [property reference](https://docs.zeroc.com/ice/3.8/property-reference.md) lists it with its default value. `getIceProperty` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a7d3ee16e5b1edf0ab060c0b748dcf8f5.html#a7d3ee16e5b1edf0ab060c0b748dcf8f5), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getIceProperty_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getIceProperty(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticeproperty), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getIceProperty), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/geticeproperty(_:))), `getIcePropertyAsInt` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a89df5433506160c5b95b644404a2dce2.html#a89df5433506160c5b95b644404a2dce2), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getIcePropertyAsInt_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getIcePropertyAsInt(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticepropertyasint), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getIcePropertyAsInt), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/geticepropertyasint(_:))), and `getIcePropertyAsList` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_abb9e28fa93514d0d28c3df788ca01356.html#abb9e28fa93514d0d28c3df788ca01356), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getIcePropertyAsList_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getIcePropertyAsList(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#geticepropertyaslist), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getIcePropertyAsList), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/geticepropertyaslist(_:))) read an Ice property and, unlike the plain `getProperty` methods, return its default value when it is not set. For example, if you never set `Ice.Warn.Dispatch`, `getIcePropertyAsInt("Ice.Warn.Dispatch")` returns its default of `1`, while `getPropertyAsInt("Ice.Warn.Dispatch")` returns `0`.

These three methods accept only the names of Ice properties. Read the other properties, such as the properties of an object adapter or a proxy, with the plain `getProperty` methods, which take any name.

## Reading and Parsing Groups of Properties

`getPropertiesForPrefix` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a79214da2a157ee75f40e269a92c292bf.html#a79214da2a157ee75f40e269a92c292bf), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getPropertiesForPrefix_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getPropertiesForPrefix(java.lang.String)), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getpropertiesforprefix), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getPropertiesForPrefix), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getpropertiesforprefix(_:))) returns the properties whose names begin with a prefix, and marks them as [used](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-overview.md#unused-properties). `parseCommandLineOptions` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_aa3157c9cfd9480d9e653df01442f706c.html#aa3157c9cfd9480d9e653df01442f706c), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_parseCommandLineOptions_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#parseCommandLineOptions(java.lang.String,java.lang.String[])), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parsecommandlineoptions), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.parseCommandLineOptions), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/parsecommandlineoptions(prefix:options:))) and `parseIceCommandLineOptions` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_a1c21945b428f0afff7850409ee54ac8c.html#a1c21945b428f0afff7850409ee54ac8c), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_parseIceCommandLineOptions_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#parseIceCommandLineOptions(java.lang.String[])), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parseicecommandlineoptions), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.parseIceCommandLineOptions), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/parseicecommandlineoptions(_:))) convert command-line arguments of the form `--name=value` into properties, with the same validation as `setProperty`, and `getCommandLineOptions` ([C++](https://code.zeroc.com/ice/3.8/api/cpp/classIce_1_1Properties_ab46acdf866a117aca7fa4c11bfeede5a.html#ab46acdf866a117aca7fa4c11bfeede5a), [C#](https://code.zeroc.com/ice/3.8/api/csharp/api/Ice.Properties.html#Ice_Properties_getCommandLineOptions_), [Java](https://code.zeroc.com/ice/3.8/api/java/com.zeroc.ice/com/zeroc/Ice/Properties.html#getCommandLineOptions()), [JavaScript](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#getcommandlineoptions), [Python](https://code.zeroc.com/ice/3.8/api/python/Ice.Properties.html#Ice.Properties.getCommandLineOptions), and [Swift](https://code.zeroc.com/ice/3.8/api/swift/documentation/ice/properties/getcommandlineoptions())) converts a property set back into such arguments.

> **JavaScript**
>
> [`parse`](https://code.zeroc.com/ice/3.8/api/javascript/Ice/Properties.html#parse) loads properties from the contents of a [configuration file](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/configuration-file-syntax.md) that you supply as a string.
