Skip to content

Commit

Permalink
fix(ObjectMap): Raw usage in static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeV220 committed Apr 29, 2024
1 parent ba10a37 commit c32c6fd
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions maps/src/main/java/com/georgev22/library/maps/ObjectMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new empty {@link LinkedObjectMap} instance.
*/
@Contract(" -> new")
static @NotNull LinkedObjectMap newLinkedObjectMap() {
return new LinkedObjectMap();
static @NotNull <K, V> LinkedObjectMap<K, V> newLinkedObjectMap() {
return new LinkedObjectMap<>();
}

/**
Expand All @@ -25,8 +25,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new empty {@link ConcurrentObjectMap} instance.
*/
@Contract(" -> new")
static @NotNull ConcurrentObjectMap newConcurrentObjectMap() {
return new ConcurrentObjectMap();
static @NotNull <K, V> ConcurrentObjectMap<K, V> newConcurrentObjectMap() {
return new ConcurrentObjectMap<>();
}

/**
Expand All @@ -35,8 +35,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new empty {@link HashObjectMap} instance.
*/
@Contract(" -> new")
static @NotNull HashObjectMap newHashObjectMap() {
return new HashObjectMap();
static @NotNull <K, V> HashObjectMap<K, V> newHashObjectMap() {
return new HashObjectMap<>();
}

/**
Expand All @@ -45,8 +45,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new empty {@link TreeObjectMap} instance.
*/
@Contract(" -> new")
static @NotNull TreeObjectMap newTreeObjectMap() {
return new TreeObjectMap();
static @NotNull <K, V> TreeObjectMap<K, V> newTreeObjectMap() {
return new TreeObjectMap<>();
}

/**
Expand All @@ -56,8 +56,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link LinkedObjectMap#LinkedObjectMap(ObjectMap)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull LinkedObjectMap newLinkedObjectMap(ObjectMap map) {
return new LinkedObjectMap(map);
static @NotNull <K, V> LinkedObjectMap<K, V> newLinkedObjectMap(ObjectMap<K, V> map) {
return new LinkedObjectMap<>(map);
}

/**
Expand All @@ -67,8 +67,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link LinkedObjectMap#LinkedObjectMap(Map)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull LinkedObjectMap newLinkedObjectMap(Map map) {
return new LinkedObjectMap(map);
static @NotNull <K, V> LinkedObjectMap<K, V> newLinkedObjectMap(Map<K, V> map) {
return new LinkedObjectMap<>(map);
}

/**
Expand All @@ -78,8 +78,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link ConcurrentObjectMap#ConcurrentObjectMap(ObjectMap)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull ConcurrentObjectMap newConcurrentObjectMap(ObjectMap map) {
return new ConcurrentObjectMap(map);
static @NotNull <K, V> ConcurrentObjectMap<K, V> newConcurrentObjectMap(ObjectMap<K, V> map) {
return new ConcurrentObjectMap<>(map);
}

/**
Expand All @@ -89,8 +89,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link ConcurrentObjectMap#ConcurrentObjectMap(Map)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull ConcurrentObjectMap newConcurrentObjectMap(Map map) {
return new ConcurrentObjectMap(map);
static @NotNull <K, V> ConcurrentObjectMap<K, V> newConcurrentObjectMap(Map<K, V> map) {
return new ConcurrentObjectMap<>(map);
}

/**
Expand All @@ -100,8 +100,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link HashObjectMap#HashObjectMap(ObjectMap)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull HashObjectMap newHashObjectMap(ObjectMap map) {
return new HashObjectMap(map);
static @NotNull <K, V> HashObjectMap<K, V> newHashObjectMap(ObjectMap<K, V> map) {
return new HashObjectMap<>(map);
}

/**
Expand All @@ -111,8 +111,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link HashObjectMap#HashObjectMap(Map)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull HashObjectMap newHashObjectMap(Map map) {
return new HashObjectMap(map);
static @NotNull <K, V> HashObjectMap<K, V> newHashObjectMap(Map<K, V> map) {
return new HashObjectMap<>(map);
}

/**
Expand All @@ -122,8 +122,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link TreeObjectMap#TreeObjectMap(ObjectMap)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull TreeObjectMap newTreeObjectMap(ObjectMap map) {
return new TreeObjectMap(map);
static @NotNull <K, V> TreeObjectMap<K, V> newTreeObjectMap(ObjectMap<K, V> map) {
return new TreeObjectMap<>(map);
}

/**
Expand All @@ -133,8 +133,8 @@ public interface ObjectMap<K, V> extends Map<K, V> {
* @return a new {@link TreeObjectMap#TreeObjectMap(Map)} initialized with the mappings from {@code map}
*/
@Contract("_ -> new")
static @NotNull TreeObjectMap newTreeObjectMap(Map map) {
return new TreeObjectMap(map);
static @NotNull <K, V> TreeObjectMap<K, V> newTreeObjectMap(Map<K, V> map) {
return new TreeObjectMap<>(map);
}


Expand Down

0 comments on commit c32c6fd

Please sign in to comment.