Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Introduce Record class. #72

Merged
merged 11 commits into from
Nov 17, 2021
Merged

Introduce Record class. #72

merged 11 commits into from
Nov 17, 2021

Conversation

blackwinter
Copy link
Member

Resolves #64.

Just add directory to source set instead of replacing the whole set.
Still exposes internal map during transitional period.
Intended as a shared type for records and map values.
Thus no longer exposing internal map.
In preparation of introducing a shared type for record values.
@blackwinter
Copy link
Member Author

Essential functionality should be ready for review now. There are still some missing pieces (esp. unit tests and Javadoc for newly introduced APIs), but I consider them optional for the purposes of this pull request (weren't present before either).

A slightly more severe issue might be that I went a little overboard with the initial assignment ;) And I did it in the wrong order, so it's not easily ripped out now. If you feel that the Value refactoring in particular should not have happened (either in the context of this pull request or at all), I'll start a new pull request from scratch.

Also, there are probably more opportunities for consolidation/simplification that I wasn't able to investigate yet.

If, however, there are no objections at all by any chance, feel free to merge right away in order to unblock further development.

@blackwinter blackwinter marked this pull request as ready for review November 16, 2021 15:56
@blackwinter blackwinter requested a review from fsteeg November 16, 2021 15:57
Obviates the need for `instanceof` checks and unchecked casts.

A `Value` is a container/wrapper for either

- an `Array` (which in turn is a wrapper for `List<Value>`), or
- a `Hash` (which in turn is a wrapper for `Map<String, Value>`), or
- a `String` (which is the terminal type)
- `Value.Hash` -> `hash`
- `key`/`k` -> `field`/`f`
Seems to be currently unused and doesn't do what it's supposed to do.

See #60 (comment).
@blackwinter blackwinter force-pushed the 64-introduceRecordClass branch 2 times, most recently from 4003d1b to ba509eb Compare November 16, 2021 16:33
@blackwinter blackwinter force-pushed the 64-introduceRecordClass branch from ba509eb to deeff8a Compare November 16, 2021 16:39
@blackwinter
Copy link
Member Author

Sorry for the noise, I'll leave it alone now!

Copy link
Member

@fsteeg fsteeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! The Value abstraction looks good. Just irritated a bit by the naming of Array and Hash for List and Map. Also field for key, I'd consider a field a key-value pair: field name and field value. However, maybe it's good to have more specific / domain / Catmandu-related naming at this level.

@fsteeg fsteeg merged commit 14789fe into master Nov 17, 2021
@fsteeg fsteeg deleted the 64-introduceRecordClass branch November 17, 2021 13:04
@blackwinter
Copy link
Member Author

blackwinter commented Nov 17, 2021 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Record class that wraps the Map<String, Object>
2 participants