Package org.ldk.structs
Class Bolt11InvoiceFeatures
- java.lang.Object
-
- org.ldk.structs.Bolt11InvoiceFeatures
-
public class Bolt11InvoiceFeatures extends Object
Features used within an invoice.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Bolt11InvoiceFeaturesclone()Creates a copy of the Bolt11InvoiceFeaturesstatic Bolt11InvoiceFeaturesempty()Create a blank Features with no features setbooleaneq(Bolt11InvoiceFeatures b)Checks if two Bolt11InvoiceFeaturess contain equal inner contents.booleanequals(Object o)protected voidfinalize()static Result_Bolt11InvoiceFeaturesDecodeErrorZread(byte[] ser)Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_writebooleanrequires_basic_mpp()Checks if this feature is required.booleanrequires_payment_metadata()Checks if this feature is required.booleanrequires_payment_secret()Checks if this feature is required.booleanrequires_unknown_bits()Returns true if this `Features` object contains unknown feature flags which are set as \"required\".booleanrequires_unknown_bits_from(Bolt11InvoiceFeatures other)Returns true if this `Features` object contains required features unknown by `other`.booleanrequires_variable_length_onion()Checks if this feature is required.voidset_basic_mpp_optional()Set this feature as optional.voidset_basic_mpp_required()Set this feature as required.Result_NoneNoneZset_optional_custom_bit(long bit)Sets an optional custom feature bit.Result_NoneNoneZset_optional_feature_bit(long bit)Sets an optional feature bit.voidset_payment_metadata_optional()Set this feature as optional.voidset_payment_metadata_required()Set this feature as required.voidset_payment_secret_optional()Set this feature as optional.voidset_payment_secret_required()Set this feature as required.Result_NoneNoneZset_required_custom_bit(long bit)Sets a required custom feature bit.Result_NoneNoneZset_required_feature_bit(long bit)Sets a required feature bit.voidset_variable_length_onion_optional()Set this feature as optional.voidset_variable_length_onion_required()Set this feature as required.booleansupports_basic_mpp()Checks if this feature is supported.booleansupports_payment_metadata()Checks if this feature is supported.booleansupports_payment_secret()Checks if this feature is supported.booleansupports_variable_length_onion()Checks if this feature is supported.byte[]write()Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
eq
public boolean eq(Bolt11InvoiceFeatures b)
Checks if two Bolt11InvoiceFeaturess contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
clone
public Bolt11InvoiceFeatures clone()
Creates a copy of the Bolt11InvoiceFeatures
-
empty
public static Bolt11InvoiceFeatures empty()
Create a blank Features with no features set
-
requires_unknown_bits_from
public boolean requires_unknown_bits_from(Bolt11InvoiceFeatures other)
Returns true if this `Features` object contains required features unknown by `other`.
-
requires_unknown_bits
public boolean requires_unknown_bits()
Returns true if this `Features` object contains unknown feature flags which are set as \"required\".
-
set_required_feature_bit
public Result_NoneNoneZ set_required_feature_bit(long bit)
Sets a required feature bit. Errors if `bit` is outside the feature range as defined by [BOLT 9]. Note: Required bits are even. If an odd bit is given, then the corresponding even bit will be set instead (i.e., `bit - 1`). [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
-
set_optional_feature_bit
public Result_NoneNoneZ set_optional_feature_bit(long bit)
Sets an optional feature bit. Errors if `bit` is outside the feature range as defined by [BOLT 9]. Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be set instead (i.e., `bit + 1`). [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
-
set_required_custom_bit
public Result_NoneNoneZ set_required_custom_bit(long bit)
Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined by [bLIP 2] or if it is a known `T` feature. Note: Required bits are even. If an odd bit is given, then the corresponding even bit will be set instead (i.e., `bit - 1`). [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
-
set_optional_custom_bit
public Result_NoneNoneZ set_optional_custom_bit(long bit)
Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined by [bLIP 2] or if it is a known `T` feature. Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be set instead (i.e., `bit + 1`). [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
-
write
public byte[] write()
Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
-
read
public static Result_Bolt11InvoiceFeaturesDecodeErrorZ read(byte[] ser)
Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
-
set_variable_length_onion_optional
public void set_variable_length_onion_optional()
Set this feature as optional.
-
set_variable_length_onion_required
public void set_variable_length_onion_required()
Set this feature as required.
-
supports_variable_length_onion
public boolean supports_variable_length_onion()
Checks if this feature is supported.
-
requires_variable_length_onion
public boolean requires_variable_length_onion()
Checks if this feature is required.
-
set_payment_secret_optional
public void set_payment_secret_optional()
Set this feature as optional.
-
set_payment_secret_required
public void set_payment_secret_required()
Set this feature as required.
-
supports_payment_secret
public boolean supports_payment_secret()
Checks if this feature is supported.
-
requires_payment_secret
public boolean requires_payment_secret()
Checks if this feature is required.
-
set_basic_mpp_optional
public void set_basic_mpp_optional()
Set this feature as optional.
-
set_basic_mpp_required
public void set_basic_mpp_required()
Set this feature as required.
-
supports_basic_mpp
public boolean supports_basic_mpp()
Checks if this feature is supported.
-
requires_basic_mpp
public boolean requires_basic_mpp()
Checks if this feature is required.
-
set_payment_metadata_optional
public void set_payment_metadata_optional()
Set this feature as optional.
-
set_payment_metadata_required
public void set_payment_metadata_required()
Set this feature as required.
-
supports_payment_metadata
public boolean supports_payment_metadata()
Checks if this feature is supported.
-
requires_payment_metadata
public boolean requires_payment_metadata()
Checks if this feature is required.
-
-