Update policy line methods for the new coverages
About this task
After Creating the coverage adapter, make a change in PolicyLineMethods to support the new policy line coverages. Add the following:
- The
AllCoverageproperty - Other properties and methods as needed
To add the property for all coverages:
Procedure
-
In Studio, open the gw.lob.package.linePolicyLineMethods class that you created in .
For Golf Cart, open gw.lob.go.GOPolicyLineMethods.gs.
-
Define the
get AllCoveragesproperty.Using Golf Cart as an example, if the policy line coverages are the only coverages within the policy line, then the following code is sufficient:
If you added coverages to other objects, you can use code similar to the following example. This example for the Golf Cart line adds coverages from the line and coverages from golf carts:override property get AllCoverages() : Coverage[] { return _line.GOLineCoverages }uses java.util.ArrayList ... override property get AllCoverages() : Coverage[] { var coverages = new ArrayList<Coverage>() coverages.addAll( _line.CoveragesFromCoverable.toList()) // add for each golf cart coverages.addAll( _line.GOCart.Coverages.toList()) return coverages as Coverage[] }Note: This code adds the line and golf cart coverages together by converting them to a linked list, because it is easier to add linked lists than to add arrays. - Define other properties and methods as needed.
- At this point, you can verify your work. For instructions, see Verify your work.
