com.mindee.product.fr.cartevitale.CarteVitaleV1Document Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mindee-api-java Show documentation
Show all versions of mindee-api-java Show documentation
Java Library to call Mindee's Off-The-Shelf and Custom APIs
package com.mindee.product.fr.cartevitale;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mindee.parsing.SummaryHelper;
import com.mindee.parsing.common.Prediction;
import com.mindee.parsing.standard.DateField;
import com.mindee.parsing.standard.StringField;
import java.util.ArrayList;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
/**
* Carte Vitale API version 1.1 document data.
*/
@Getter
@EqualsAndHashCode(callSuper = false)
@JsonIgnoreProperties(ignoreUnknown = true)
public class CarteVitaleV1Document extends Prediction {
/**
* The given name(s) of the card holder.
*/
@JsonProperty("given_names")
protected List givenNames = new ArrayList<>();
/**
* The date the card was issued.
*/
@JsonProperty("issuance_date")
protected DateField issuanceDate;
/**
* The Social Security Number (Numéro de Sécurité Sociale) of the card holder
*/
@JsonProperty("social_security")
protected StringField socialSecurity;
/**
* The surname of the card holder.
*/
@JsonProperty("surname")
protected StringField surname;
@Override
public boolean isEmpty() {
return (
(this.givenNames == null || this.givenNames.isEmpty())
&& this.surname == null
&& this.socialSecurity == null
&& this.issuanceDate == null
);
}
@Override
public String toString() {
StringBuilder outStr = new StringBuilder();
String givenNames = SummaryHelper.arrayToString(
this.getGivenNames(),
"%n "
);
outStr.append(
String.format(":Given Name(s): %s%n", givenNames)
);
outStr.append(
String.format(":Surname: %s%n", this.getSurname())
);
outStr.append(
String.format(":Social Security Number: %s%n", this.getSocialSecurity())
);
outStr.append(
String.format(":Issuance Date: %s%n", this.getIssuanceDate())
);
return SummaryHelper.cleanSummary(outStr.toString());
}
}