Skip to content

Commit decd5f7

Browse files
committed
Adds missing Immutable annotations.
1 parent de7c1b3 commit decd5f7

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

src/main/java/org/javimmutable/collections/hash/map/MapEmptyNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@
4848

4949
import javax.annotation.Nonnull;
5050
import javax.annotation.Nullable;
51+
import javax.annotation.concurrent.Immutable;
5152

53+
@Immutable
5254
public class MapEmptyNode<K, V>
5355
implements MapNode<K, V>
5456
{
5557
private static final MapEmptyNode EMPTY = new MapEmptyNode();
5658

57-
5859
@SuppressWarnings("unchecked")
5960
public static <K, V> MapNode<K, V> of()
6061
{

src/main/java/org/javimmutable/collections/hash/map/MapMultiKeyLeafNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@
4848

4949
import javax.annotation.Nonnull;
5050
import javax.annotation.Nullable;
51+
import javax.annotation.concurrent.Immutable;
5152

5253
/**
5354
* HamtNode that stores only one value. Any assign that would progress down the tree
5455
* below this node replaces it with a normal node instead. These exist to shorten the
5556
* height of the overall tree structure when hashCodes are dispersed.
5657
*/
58+
@Immutable
5759
public class MapMultiKeyLeafNode<K, V>
5860
implements MapNode<K, V>
5961
{

src/main/java/org/javimmutable/collections/hash/map/MapSingleKeyLeafNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
import javax.annotation.Nonnull;
5050
import javax.annotation.Nullable;
51+
import javax.annotation.concurrent.Immutable;
5152
import java.util.Objects;
5253

5354
import static org.javimmutable.collections.MapEntry.entry;
@@ -57,6 +58,7 @@
5758
* below this node replaces it with a branch node instead. These exist to shorten the
5859
* height of the overall tree structure when hashCodes are dispersed.
5960
*/
61+
@Immutable
6062
public class MapSingleKeyLeafNode<K, V>
6163
implements MapNode<K, V>
6264
{

src/main/java/org/javimmutable/collections/hash/set/SetEmptyNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444

4545
import javax.annotation.Nonnull;
4646
import javax.annotation.Nullable;
47+
import javax.annotation.concurrent.Immutable;
4748

49+
@Immutable
4850
public class SetEmptyNode<T>
4951
implements SetNode<T>
5052
{

src/main/java/org/javimmutable/collections/hash/set/SetMultiValueLeafNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@
4444

4545
import javax.annotation.Nonnull;
4646
import javax.annotation.Nullable;
47+
import javax.annotation.concurrent.Immutable;
4748

4849
/**
4950
* HamtNode that stores only one value. Any assign that would progress down the tree
5051
* below this node replaces it with a normal node instead. These exist to shorten the
5152
* height of the overall tree structure when hashCodes are dispersed.
5253
*/
54+
@Immutable
5355
public class SetMultiValueLeafNode<T>
5456
implements SetNode<T>
5557
{

src/main/java/org/javimmutable/collections/hash/set/SetSingleValueLeafNode.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@
4444

4545
import javax.annotation.Nonnull;
4646
import javax.annotation.Nullable;
47+
import javax.annotation.concurrent.Immutable;
4748
import java.util.Objects;
4849

4950
/**
5051
* SetNode that stores only one value. Any assign that would progress down the tree
5152
* below this node replaces it with a branch node instead. These exist to shorten the
5253
* height of the overall tree structure when hashCodes are dispersed.
5354
*/
55+
@Immutable
5456
public class SetSingleValueLeafNode<T>
5557
implements SetNode<T>
5658
{

0 commit comments

Comments
 (0)