/** * Gets the first repetition for <b>address</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * One or more addresses for the person * </p> */ public AddressDt getAddressFirstRep() { if (getAddress().isEmpty()) { return addAddress(); } return getAddress().get(0); }
/** * Gets the first repetition for <b>identifier</b> (id), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * Identifier for a person within a particular scope. * </p> */ public IdentifierDt getIdentifierFirstRep() { if (getIdentifier().isEmpty()) { return addIdentifier(); } return getIdentifier().get(0); }
/** * Gets the first repetition for <b>telecom</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * A contact detail for the person, e.g. a telephone number or an email address. * </p> */ public ContactPointDt getTelecomFirstRep() { if (getTelecom().isEmpty()) { return addTelecom(); } return getTelecom().get(0); }
public class PersonModelDeserializer implements JsonDeserializer<Person> { @Override public Person deserialize(JsonElement paramJsonElement, Type paramType, JsonDeserializationContext paramJsonDeserializationContext) throws JsonParseException { Person person = new Gson().fromJson(paramJsonElement.getAsJsonObject(), Person.class); try { Gender gender = null; if (paramJsonElement.getAsJsonObject().get("gender") != null) { gender = Gender.valueOf(paramJsonElement.getAsJsonObject().get("gender").getAsString().toUpperCase()); } person.setGender(gender); } catch (IllegalArgumentException ie) { System.out.println(ie.getMessage()); System.out.println("Gender cannot be serialized .."); } return person; } }
/** * Adds a given new value for <b>address</b> () * * <p> * <b>Definition:</b> * One or more addresses for the person * </p> * @param theValue The address to add (must not be <code>null</code>) */ public Person addAddress(AddressDt theValue) { if (theValue == null) { throw new NullPointerException("theValue must not be null"); } getAddress().add(theValue); return this; }
/** * Gets the value(s) for <b>gender</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Administrative Gender * </p> */ public String getGender() { return getGenderElement().getValue(); }
/** * Gets the value(s) for <b>active</b> (status). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * Whether this person's record is in active use * </p> */ public Boolean getActive() { return getActiveElement().getValue(); }
/** * Gets the value(s) for <b>birthDate</b> (). * creating it if it does * not exist. This method may return <code>null</code>. * * <p> * <b>Definition:</b> * The birth date for the person. * </p> */ public Date getBirthDate() { return getBirthDateElement().getValue(); }
/** * Sets the value(s) for <b>gender</b> () * * <p> * <b>Definition:</b> * Administrative Gender * </p> */ public Person setGender(AdministrativeGenderEnum theValue) { setGender(new BoundCodeDt<AdministrativeGenderEnum>(AdministrativeGenderEnum.VALUESET_BINDER, theValue)); /* getGenderElement().setValueAsEnum(theValue); */ return this; }
/** * Adds and returns a new value for <b>address</b> () * * <p> * <b>Definition:</b> * One or more addresses for the person * </p> */ public AddressDt addAddress() { AddressDt newType = new AddressDt(); getAddress().add(newType); return newType; }