/** * Returns child list item modification if {@code child} was modified by this modification. * * @param caseType Case type class * @param listItem Type of list item - must be list item with key * @param listKey List item key * @return Modification of {@code child} if {@code child} was modified, null otherwise. * @throws IllegalArgumentException If supplied {@code listItem} class is not valid child according * to generated model. */ default <H extends ChoiceIn<? super T> & DataObject, C extends Identifiable<K> & ChildOf<? super H>, K extends Identifier<C>> DataObjectModification<C> getModifiedChildListItem( @Nonnull final Class<H> caseType, @Nonnull final Class<C> listItem, @Nonnull final K listKey) { return (DataObjectModification<C>) getModifiedChild(IdentifiableItem.of(caseType, listItem, listKey)); }
/** * Returns container child modification if {@code child} was modified by this modification. This method should be * used if the child is defined in a grouping brought into a case inside this object. * * <p> * For accessing all modified list items consider iterating over {@link #getModifiedChildren()}. * * @param caseType Case type class * @param child Type of child - must be only container * @return Modification of {@code child} if {@code child} was modified, null otherwise. * @throws IllegalArgumentException If supplied {@code child} class is not valid child according * to generated model. */ default @Nullable <H extends ChoiceIn<? super T> & DataObject, C extends ChildOf<? super H>> DataObjectModification<C> getModifiedChildContainer(@Nonnull final Class<H> caseType, @Nonnull final Class<C> child) { return (DataObjectModification<C>) getModifiedChild(Item.of(caseType, child)); }