Class CaseTransaction
-
- All Implemented Interfaces:
public final class CaseTransactionA single transaction associated with a case. The
categoryfield identifies whether this is a card transaction or a payment transaction.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCaseTransaction.VisitorAn interface that defines how to map each variant of CaseTransaction to a value of type T.
public final classCaseTransaction.CardCaseTransactionA card transaction associated with a case
public final classCaseTransaction.PaymentCaseTransactionA payment (ACH) transaction associated with a case
-
Method Summary
Modifier and Type Method Description final Optional<CaseTransaction.CardCaseTransaction>card()A card transaction associated with a case final Optional<CaseTransaction.PaymentCaseTransaction>payment()A payment (ACH) transaction associated with a case final BooleanisCard()final BooleanisPayment()final CaseTransaction.CardCaseTransactionasCard()A card transaction associated with a case final CaseTransaction.PaymentCaseTransactionasPayment()A payment (ACH) transaction associated with a case final Optional<JsonValue>_json()final <T extends Any> Taccept(CaseTransaction.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final CaseTransactionvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static CaseTransactionofCard(CaseTransaction.CardCaseTransaction card)A card transaction associated with a case final static CaseTransactionofPayment(CaseTransaction.PaymentCaseTransaction payment)A payment (ACH) transaction associated with a case -
-
Method Detail
-
card
final Optional<CaseTransaction.CardCaseTransaction> card()
A card transaction associated with a case
-
payment
final Optional<CaseTransaction.PaymentCaseTransaction> payment()
A payment (ACH) transaction associated with a case
-
asCard
final CaseTransaction.CardCaseTransaction asCard()
A card transaction associated with a case
-
asPayment
final CaseTransaction.PaymentCaseTransaction asPayment()
A payment (ACH) transaction associated with a case
-
accept
final <T extends Any> T accept(CaseTransaction.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 = caseTransaction.accept(new CaseTransaction.Visitor<Optional<String>>() { @Override public Optional<String> visitCard(CardCaseTransaction card) { return Optional.of(card.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final CaseTransaction 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.
-
ofCard
final static CaseTransaction ofCard(CaseTransaction.CardCaseTransaction card)
A card transaction associated with a case
-
ofPayment
final static CaseTransaction ofPayment(CaseTransaction.PaymentCaseTransaction payment)
A payment (ACH) transaction associated with a case
-
-
-
-