[MDSAL-5] InstanceIdentifierBuilder needs to be a copy-based builder Created: 13/Feb/14  Updated: 04/Aug/18  Resolved: 04/Aug/18

Status: Resolved
Project: mdsal
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Robert Varga Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

The default InstanceIdentifierBuilder needs to be a copy builder, such that it has stable state and the following code is valid (seen in the wild):

InstanceIdentifierBuilder<Foo> foob = InstanceIdentfier.builder(Foo.class);

dataProviderService.removeOperationalData(foob.augmentation(Bar.class).build));
dataProviderService.removeOperationalData(foob.augmentation(Baz.class).build));

Once it is stable, also add hashCode()/equals() so it can be kept around safely.

The current mutable version may be retained as an explicit MutableInstanceIdentifierBuilder or something of that kind.



 Comments   
Comment by Robert Varga [ 04/Aug/18 ]

I don't this is worth doing.

Generated at Wed Feb 07 20:08:24 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.