@Override public Base setProperty(String name, Base value) throws FHIRException { if (name.equals("use")) { value = new NameUseEnumFactory().fromType(castToCode(value)); this.use = (Enumeration) value; // Enumeration<NameUse> } else if (name.equals("text")) { this.text = castToString(value); // StringType } else if (name.equals("family")) { this.family = castToString(value); // StringType } else if (name.equals("given")) { this.getGiven().add(castToString(value)); } else if (name.equals("prefix")) { this.getPrefix().add(castToString(value)); } else if (name.equals("suffix")) { this.getSuffix().add(castToString(value)); } else if (name.equals("period")) { this.period = castToPeriod(value); // Period } else return super.setProperty(name, value); return value; }
@Override public Base setProperty(int hash, String name, Base value) throws FHIRException { switch (hash) { case 116103: // use value = new NameUseEnumFactory().fromType(castToCode(value)); this.use = (Enumeration) value; // Enumeration<NameUse> return value; case 3556653: // text this.text = castToString(value); // StringType return value; case -1281860764: // family this.family = castToString(value); // StringType return value; case 98367357: // given this.getGiven().add(castToString(value)); // StringType return value; case -980110702: // prefix this.getPrefix().add(castToString(value)); // StringType return value; case -891422895: // suffix this.getSuffix().add(castToString(value)); // StringType return value; case -991726143: // period this.period = castToPeriod(value); // Period return value; default: return super.setProperty(hash, name, value); } }