Apache Geode Native .NET Reference 1.15.0
Apache::Geode::Client::Properties< TPropKey, TPropValue > Class Template Reference

Provides a collection of properties, each of which is a key/value pair. More...

#include <Properties.hpp>

Inherits Apache::Geode::Client::IDataSerializablePrimitive.

Public Member Functions

TPropValue Find (TPropKey key)
 Return the value for the given key, or NULL if not found. More...
 
void ForEach (PropertyVisitorGeneric< TPropKey, TPropValue >^ visitor)
 Execute the Visitor delegate for each entry in the collection. More...
 
virtual void FromData (DataInput^ input)
 Deserializes this Properties object. More...
 
void Insert (TPropKey key, TPropValue value)
 Add or update the string value for key. More...
 
void Load (String^ fileName)
 Reads property values from a file, overriding what is currently in the properties object. More...
 
 Properties ()
 Default constructor: returns an empty collection. More...
 
void Remove (TPropKey key)
 Remove the key from the collection. More...
 
virtual void ToData (DataOutput^ output)
 Serializes this Properties object. More...
 
virtual String ^ ToString () override
 Returns a string representation of the current Properties object. More...
 

Static Public Member Functions

static Properties< TPropKey, TPropValue > ^ Create ()
 Factory method to create an empty collection of properties. More...
 

Properties

virtual System::UInt64 ObjectSize [get]
 return the size of this object in bytes More...
 
System::UInt32 Size [get]
 Return the number of entries in the collection. More...
 

Detailed Description

template<class TPropKey, class TPropValue>
class Apache::Geode::Client::Properties< TPropKey, TPropValue >

Provides a collection of properties, each of which is a key/value pair.

Each key is a string, and the value may be a string or an integer.

Constructor & Destructor Documentation

◆ Properties()

template<class TPropKey , class TPropValue >
Apache::Geode::Client::Properties< TPropKey, TPropValue >::Properties ( )
inline

Default constructor: returns an empty collection.

Member Function Documentation

◆ Create()

template<class TPropKey , class TPropValue >
static Properties< TPropKey, TPropValue > ^ Apache::Geode::Client::Properties< TPropKey, TPropValue >::Create ( )
inlinestatic

Factory method to create an empty collection of properties.

Returns
empty collection of properties

◆ Find()

template<class TPropKey , class TPropValue >
TPropValue Apache::Geode::Client::Properties< TPropKey, TPropValue >::Find ( TPropKey  key)

Return the value for the given key, or NULL if not found.

Parameters
keythe key to find
Returns
the value for the key
Exceptions
NullPointerExceptionif the key is null

◆ ForEach()

template<class TPropKey , class TPropValue >
void Apache::Geode::Client::Properties< TPropKey, TPropValue >::ForEach ( PropertyVisitorGeneric< TPropKey, TPropValue >^  visitor)

Execute the Visitor delegate for each entry in the collection.

Parameters
visitorvisitor delegate

◆ FromData()

template<class TPropKey , class TPropValue >
virtual void Apache::Geode::Client::Properties< TPropKey, TPropValue >::FromData ( DataInput input)
virtual

Deserializes this Properties object.

Parameters
inputthe DataInput stream to use for reading data
Returns
the deserialized Properties object

◆ Insert()

template<class TPropKey , class TPropValue >
void Apache::Geode::Client::Properties< TPropKey, TPropValue >::Insert ( TPropKey  key,
TPropValue  value 
)

Add or update the string value for key.

Parameters
keythe key to insert
valuethe string value to insert
Exceptions
NullPointerExceptionif the key is null

◆ Load()

template<class TPropKey , class TPropValue >
void Apache::Geode::Client::Properties< TPropKey, TPropValue >::Load ( String^  fileName)

Reads property values from a file, overriding what is currently in the properties object.

Parameters
fileNamethe name of the file

◆ Remove()

template<class TPropKey , class TPropValue >
void Apache::Geode::Client::Properties< TPropKey, TPropValue >::Remove ( TPropKey  key)

Remove the key from the collection.

Parameters
keythe key to remove
Exceptions
NullPointerExceptionif the key is null

◆ ToData()

template<class TPropKey , class TPropValue >
virtual void Apache::Geode::Client::Properties< TPropKey, TPropValue >::ToData ( DataOutput output)
virtual

Serializes this Properties object.

Parameters
outputthe DataOutput stream to use for serialization

◆ ToString()

template<class TPropKey , class TPropValue >
virtual String ^ Apache::Geode::Client::Properties< TPropKey, TPropValue >::ToString ( )
overridevirtual

Returns a string representation of the current Properties object.

Returns
A comma separated list of property name,value pairs.

Implements Apache::Geode::Client::ISerializable.

Property Documentation

◆ ObjectSize

template<class TPropKey , class TPropValue >
virtual System:: UInt64 Apache::Geode::Client::Properties< TPropKey, TPropValue >::ObjectSize
get

return the size of this object in bytes

◆ Size

template<class TPropKey , class TPropValue >
System:: UInt32 Apache::Geode::Client::Properties< TPropKey, TPropValue >::Size
get

Return the number of entries in the collection.

Returns
the number of entries

Apache Geode C++ Cache .NET API Documentation