4#include <xrpl/protocol/STLedgerEntry.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/LedgerEntryBase.h>
8#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
9#include <xrpl/json/json_value.h>
42 throw std::runtime_error(
"Invalid ledger entry type for NegativeUNL");
57 if (this->
sle_->isFieldPresent(sfDisabledValidators))
58 return this->
sle_->getFieldArray(sfDisabledValidators);
70 return this->
sle_->isFieldPresent(sfDisabledValidators);
82 return this->
sle_->at(sfValidatorToDisable);
94 return this->
sle_->isFieldPresent(sfValidatorToDisable);
106 return this->
sle_->at(sfValidatorToReEnable);
118 return this->
sle_->isFieldPresent(sfValidatorToReEnable);
130 return this->
sle_->at(sfPreviousTxnID);
142 return this->
sle_->isFieldPresent(sfPreviousTxnID);
154 return this->
sle_->at(sfPreviousTxnLgrSeq);
166 return this->
sle_->isFieldPresent(sfPreviousTxnLgrSeq);
195 if (sle->at(sfLedgerEntryType) != ltNEGATIVE_UNL)
211 object_.setFieldArray(sfDisabledValidators, value);
222 object_[sfValidatorToDisable] = value;
233 object_[sfValidatorToReEnable] = value;
244 object_[sfPreviousTxnID] = value;
255 object_[sfPreviousTxnLgrSeq] = value;
std::shared_ptr< STLedgerEntry const > const_pointer
LedgerEntryBase(SLE::const_pointer sle)
Construct a ledger entry wrapper from an existing SLE object.
SLE::const_pointer sle_
The underlying serialized ledger entry being wrapped.
LedgerEntryBuilderBase()=default
Builder for NegativeUNL ledger entries.
NegativeUNLBuilder()
Construct a new NegativeUNLBuilder with required fields.
NegativeUNLBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeOptional).
NegativeUNLBuilder & setValidatorToDisable(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfValidatorToDisable (SoeOptional).
NegativeUNLBuilder & setDisabledValidators(STArray const &value)
Ledger entry-specific field setters.
NegativeUNLBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (SoeOptional).
NegativeUNLBuilder & setValidatorToReEnable(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfValidatorToReEnable (SoeOptional).
NegativeUNLBuilder(SLE::const_pointer sle)
Construct a NegativeUNLBuilder from an existing SLE object.
NegativeUNL build(uint256 const &index)
Build and return the completed NegativeUNL wrapper.
Ledger Entry: NegativeUNL.
protocol_autogen::Optional< SF_UINT256::type::value_type > getPreviousTxnID() const
Get sfPreviousTxnID (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getValidatorToDisable() const
Get sfValidatorToDisable (SoeOptional).
bool hasDisabledValidators() const
Check if sfDisabledValidators is present.
bool hasPreviousTxnLgrSeq() const
Check if sfPreviousTxnLgrSeq is present.
bool hasValidatorToDisable() const
Check if sfValidatorToDisable is present.
std::optional< std::reference_wrapper< STArray const > > getDisabledValidators() const
Get sfDisabledValidators (SoeOptional).
bool hasPreviousTxnID() const
Check if sfPreviousTxnID is present.
NegativeUNL(SLE::const_pointer sle)
Construct a NegativeUNL ledger entry wrapper from an existing SLE object.
protocol_autogen::Optional< SF_VL::type::value_type > getValidatorToReEnable() const
Get sfValidatorToReEnable (SoeOptional).
static constexpr LedgerEntryType entryType
protocol_autogen::Optional< SF_UINT32::type::value_type > getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeOptional).
bool hasValidatorToReEnable() const
Check if sfValidatorToReEnable is present.
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
LedgerEntryType
Identifiers for on-ledger objects.