iceberg-cpp
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
iceberg::PropertyUtil Class Reference

Static Public Member Functions

static Status ValidateCommitProperties (const std::unordered_map< std::string, std::string > &properties)
 
static bool PropertyAsBoolean (const std::unordered_map< std::string, std::string > &properties, std::string_view key, bool default_value)
 Read a boolean property from a property map.
 
static std::optional< bool > PropertyAsOptionalBoolean (const std::unordered_map< std::string, std::string > &properties, std::string_view key)
 Read a boolean property that may be unset.
 

Member Function Documentation

◆ PropertyAsBoolean()

static bool iceberg::PropertyUtil::PropertyAsBoolean ( const std::unordered_map< std::string, std::string > &  properties,
std::string_view  key,
bool  default_value 
)
static

Read a boolean property from a property map.

Mirrors Java's PropertyUtil.propertyAsBoolean: the value is parsed with StringUtils::ParseBoolean, so anything that is not "true" ignoring case reads as false rather than being rejected.

Parameters
propertiesThe property map to read from.
keyThe property key.
default_valueReturned when the property is absent.
Returns
The parsed value, or default_value if the property is absent.

◆ PropertyAsOptionalBoolean()

static std::optional< bool > iceberg::PropertyUtil::PropertyAsOptionalBoolean ( const std::unordered_map< std::string, std::string > &  properties,
std::string_view  key 
)
static

Read a boolean property that may be unset.

Like PropertyAsBoolean, but returns std::nullopt when the property is absent so callers can distinguish an unset property from an explicit "false". Mirrors Java's PropertyUtil.propertyAsNullableBoolean.

Parameters
propertiesThe property map to read from.
keyThe property key.
Returns
The parsed value, or std::nullopt if the property is absent.

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