Package com.lithic.api.models
Class Payment.MethodAttributes
-
- All Implemented Interfaces:
public final class Payment.MethodAttributesMethod-specific attributes
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePayment.MethodAttributes.VisitorAn interface that defines how to map each variant of MethodAttributes to a value of type T.
public final classPayment.MethodAttributes.AchMethodAttributespublic final classPayment.MethodAttributes.WireMethodAttributes
-
Method Summary
Modifier and Type Method Description final Optional<Payment.MethodAttributes.AchMethodAttributes>ach()final Optional<Payment.MethodAttributes.WireMethodAttributes>wire()final BooleanisAch()final BooleanisWire()final Payment.MethodAttributes.AchMethodAttributesasAch()final Payment.MethodAttributes.WireMethodAttributesasWire()final Optional<JsonValue>_json()final <T extends Any> Taccept(Payment.MethodAttributes.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final Payment.MethodAttributesvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Payment.MethodAttributesofAch(Payment.MethodAttributes.AchMethodAttributes ach)final static Payment.MethodAttributesofWire(Payment.MethodAttributes.WireMethodAttributes wire)-
-
Method Detail
-
ach
final Optional<Payment.MethodAttributes.AchMethodAttributes> ach()
-
wire
final Optional<Payment.MethodAttributes.WireMethodAttributes> wire()
-
asAch
final Payment.MethodAttributes.AchMethodAttributes asAch()
-
asWire
final Payment.MethodAttributes.WireMethodAttributes asWire()
-
accept
final <T extends Any> T accept(Payment.MethodAttributes.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.lithic.api.core.JsonValue; import java.util.Optional; Optional<String> result = methodAttributes.accept(new MethodAttributes.Visitor<Optional<String>>() { @Override public Optional<String> visitAch(AchMethodAttributes ach) { return Optional.of(ach.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final Payment.MethodAttributes validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofAch
final static Payment.MethodAttributes ofAch(Payment.MethodAttributes.AchMethodAttributes ach)
-
ofWire
final static Payment.MethodAttributes ofWire(Payment.MethodAttributes.WireMethodAttributes wire)
-
-
-
-