Package com.tryfinch.api.models
Class EmploymentData
-
- All Implemented Interfaces:
public final class EmploymentData
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceEmploymentData.VisitorAn interface that defines how to map each variant of EmploymentData to a value of type T.
public final classEmploymentData.EmploymentDataResponseBodypublic final classEmploymentData.BatchError
-
Method Summary
Modifier and Type Method Description final Optional<EmploymentData.EmploymentDataResponseBody>responseBody()final Optional<EmploymentData.BatchError>batchError()final BooleanisResponseBody()final BooleanisBatchError()final EmploymentData.EmploymentDataResponseBodyasResponseBody()final EmploymentData.BatchErrorasBatchError()final Optional<JsonValue>_json()final <T extends Any> Taccept(EmploymentData.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final EmploymentDatavalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static EmploymentDataofResponseBody(EmploymentData.EmploymentDataResponseBody responseBody)final static EmploymentDataofBatchError(EmploymentData.BatchError batchError)-
-
Method Detail
-
responseBody
final Optional<EmploymentData.EmploymentDataResponseBody> responseBody()
-
batchError
final Optional<EmploymentData.BatchError> batchError()
-
isResponseBody
final Boolean isResponseBody()
-
isBatchError
final Boolean isBatchError()
-
asResponseBody
final EmploymentData.EmploymentDataResponseBody asResponseBody()
-
asBatchError
final EmploymentData.BatchError asBatchError()
-
accept
final <T extends Any> T accept(EmploymentData.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.tryfinch.api.core.JsonValue; import java.util.Optional; Optional<String> result = employmentData.accept(new EmploymentData.Visitor<Optional<String>>() { @Override public Optional<String> visitResponseBody(EmploymentDataResponseBody responseBody) { return Optional.of(responseBody.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final EmploymentData 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.
-
ofResponseBody
final static EmploymentData ofResponseBody(EmploymentData.EmploymentDataResponseBody responseBody)
-
ofBatchError
final static EmploymentData ofBatchError(EmploymentData.BatchError batchError)
-
-
-
-