public interface IBuilder
The builder should be used when a DDMS record needs to be built up over time, but validation should not occur until the end. The commit() method attempts to finalize the immutable object based on the values gathered.
The builder approach differs from calling the immutable constructor directly because it treats a Builder instance with no values provided as "no component" instead of "a component with missing values". For example, calling a constructor directly with an empty string for a required parameter might throw an InvalidDDMSException, while calling commit() on a Builder without setting any values would just return null.
Modifier and Type | Method and Description |
---|---|
IDDMSComponent |
commit()
Finalizes the data gathered for this builder instance.
|
boolean |
isEmpty()
Checks if any values have been provided for this Builder.
|
IDDMSComponent commit() throws InvalidDDMSException
InvalidDDMSException
- if any required information is missing or malformedboolean isEmpty()
Copyright 2010 - 2019 by Brian Uri!
Generated on 09/15/2016 12:36 PM
https://ddmsence.urizone.net/