Modern C++ Kafka API
Public Types | Public Member Functions | List of all members
KAFKA_API::Properties Class Reference

The properties for Kafka clients. More...

#include <Properties.h>

Inheritance diagram for KAFKA_API::Properties:
KAFKA_API::clients::Config KAFKA_API::clients::admin::AdminClientConfig KAFKA_API::clients::consumer::ConsumerConfig KAFKA_API::clients::producer::ProducerConfig

Public Types

using PropertiesMap = std::map< std::string, ValueType >
 

Public Member Functions

 Properties (const Properties &)=default
 
 Properties (PropertiesMap kvMap)
 
bool operator== (const Properties &rhs) const
 
template<class T >
Propertiesput (const std::string &key, const T &value)
 Set a property. More...
 
void remove (const std::string &key)
 Remove the property (if one exists).
 
bool contains (const std::string &key) const
 Check whether the map contains a property.
 
template<class T >
T & get (const std::string &key) const
 Get a property reference. More...
 
Optional< std::string > getProperty (const std::string &key) const
 Get a property.
 
void eraseProperty (const std::string &key)
 Remove a property.
 
std::string toString () const
 
const PropertiesMap & map () const
 Get all properties with a map.
 

Detailed Description

The properties for Kafka clients.

Member Function Documentation

◆ get()

template<class T >
T& KAFKA_API::Properties::get ( const std::string &  key) const
inline

Get a property reference.

If the property doesn't exist, an execption would be thrown.

◆ put()

template<class T >
Properties& KAFKA_API::Properties::put ( const std::string &  key,
const T &  value 
)
inline

Set a property.

If the map previously contained a mapping for the key, the old value is replaced by the specified value.


The documentation for this class was generated from the following file: