Problem I have a User entity. Each instance of the User class should have a first name, surname and email, […]
Tag: immutability
Removing getters for a custom enum [closed]
Problem Closed. This question is off-topic. It is not currently accepting answers. This question does not appear to be a […]
Class that holds calculation results and has to be immutable
Problem I’m roughly trying to follow the guidelines in “Effective Java”, “Item 15: Minimize mutability”, hence the class is not […]
Creating Immutable Student Object
Problem For a project I’m working on I have the following requirements: We have two student types: Domestic and International […]
Quicksort in JavaScript assuming an immutable array
Problem Update: further succinct versions below (inspired by Haskell) Quick sort in JS assuming an immutable array: const reorder = […]
Immutable Linked List in VBA
Problem I made an immutable list class using the head-tail idiom. If I did this correctly, it implements persistent data […]
Should I copy list both in constructor and in getter?
Problem I have a simple immutable class: public class ColumnsWrapper implements Columns { private final List<String> columnNames; public ColumnsWrapper(List<String> columnNames) […]
Circular dependencies between immutable objects; the Freeze Pattern
Problem Generally, I structure small threadsafe immutable objects like this: public class SmallObject { private final String state; public SmallObject(final […]
Yet another immutable string
Problem I know, there are a few implementations of immutable strings out there, but my focus seems to be a […]
Subclassing `int` to make colors
Problem In the ROOT framework (originally a C++ framework, but python bindings are also supplied), colors are objects (ROOT.TColor) identified […]
- 1
- 2