Ticket #632 (closed Enhancement: fixed)

Opened 7 years ago

Last modified 7 years ago

Core API: CompositeValueModel should be an Iterable

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.3
Component: DeepaMehta Standard Distribution Version: 4.2
Keywords: Cc: dgf, Malte
Complexity: 2 Area: Application Framework / API
Module: deepamehta-core

Description (last modified by jri) (diff)

... of child type URIs (String).

Furthermore for multiple-valued childs there should be an addAll() method.

Change History

comment:1 Changed 7 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 7 years ago by Jörg Richter

  • Status changed from accepted to closed
  • Resolution set to fixed

Core API: CompositeValueModel? is Iterable (#632).

BREAKING CHANGE

Method dropped in CompositeValueModel?:

  • Iterable<String> keys()

Instead a CompositeValueModel? is itself an Iterable<String>

Close #632

comment:3 Changed 7 years ago by jri

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Description modified (diff)

comment:4 follow-up: ↓ 6 Changed 7 years ago by Jörg Richter

  • Status changed from reopened to closed
  • Resolution set to fixed

Core: add addAll() to CompositeValueModel? (#632).

CompositeValueModel has a method to add many values to a multiple-valued child:

CompositeValueModel addAll(String childTypeUri, List<TopicModel> values)

Close #632.

comment:5 Changed 7 years ago by Jörg Richter

Core: add method to CompositeValueModel? (#632).

CompositeValueModel has a method to add a by-ID topic deletion reference to a multiple-valued child:

CompositeValueModel addDeletionRef(String childTypeUri, long refTopicId)

See #632.

comment:6 in reply to: ↑ 4 Changed 7 years ago by jri

  • Status changed from closed to reopened
  • Resolution fixed deleted

CompositeValueModel has a method to add many values to a multiple-valued child:

CompositeValueModel addAll(String childTypeUri, List<TopicModel> values)

Bug: addAll() does not create an entry in CompositeValueModel if no one exists so far and if the passed list is empty. In this case it should create an entry containing an empty list instead.

comment:7 Changed 7 years ago by Jörg Richter

Core API: CompositeValueModel? addAll->put (#632).

BREAKING CHANGE

The Core API's CompositeValueModel has 2 changes:

  1. The add() methods does *not* check for multiple values anymore. Values can be added twice.
    add(String childTypeUri, TopicModel value)
    
  1. The addAll() method is renamed to put() and has a changed semantics: the passed values override possibly extisting values (as the single-valued put() counterparts do) instead of adding them.
    addAll(String childTypeUri, List<TopicModel> values) -> put(String childTypeUri, List<TopicModel> values)
    

Fix: if the passed list is empty, after calling put() there is still a new entry in the CompositeValueModel (its value is the empty list).

See #632.

comment:8 Changed 7 years ago by Jörg Richter

comment:9 Changed 7 years ago by jri

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.