You must create implementations for your skeletal setter methods created above. Each setter method is responsible for taking a value (either primitive or object) supplied by calling code and setting one or more fields in an underlying Dtls struct.
Private setters must detail their own JavaDoc (as there is no API JavaDoc to inherit from).
The setter for the name field maps the value provided to the name field on the Dtls struct. The setter must trim/compress white space and convert any null value passed to an empty string:
/** * {@inheritDoc} */ public void setName(final String value) { getDtls().name = StringHelper.trim(value); }
The StringHelper class contains the convenience method trim which converts a null to an empty string, trims white space from the ends of genuine strings passed and compresses any contiguous embedded spaces down to a single space.
The setter for the date range field must set two values on the underlying Dtls struct:
/** * Sets the start and end fields from the date range supplied. * * @param value * the date range supplied */ private void setDateRange(final DateRange value) { getDtls().startDate = value.start(); getDtls().endDate = value.end(); }
The setter for the typeCode database column must convert the state supplied into its codetable code for storage on the database:
/** * {@inheritDoc} */ public void setType(final MYNEWENTITYTYPEEntry value) { getDtls().typeCode = value.getCode(); }
The setter for a related record must retrieve the object's ID and store it in the appropriate field on the Dtls struct. A null value must be converted to zero:
/** * {@inheritDoc} */ public void setMyParentEntity(final MyParentEntity value) { final long myParentEntityID; if (value == null) { myParentEntityID = 0; } else { myParentEntityID = value.getID(); } getDtls().myParentEntityID = myParentEntityID; }