Skip to content

Commit 5db164a

Browse files
enhance README.md
set jdk requirement to JDK8+
1 parent 4ca1389 commit 5db164a

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 24 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ TTLHashMap is a Java library that provides a thread-safe hash map implementation
1010
- Support for custom actions when entries expire
1111
- Flexible TTL units (seconds, minutes, hours, etc.)
1212

13-
## Usage
13+
## Requirements
14+
Use Java 8+
1415

16+
## Usage
1517
Here's a quick example of how to use TTLHashMap:
1618

1719
```java

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<version>1.0-SNAPSHOT</version>
1010

1111
<properties>
12-
<maven.compiler.source>23</maven.compiler.source>
13-
<maven.compiler.target>23</maven.compiler.target>
12+
<maven.compiler.source>8</maven.compiler.source>
13+
<maven.compiler.target>8</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
</properties>
1616

src/main/java/com/athingforcode/TTLHashMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void shutdown() {
3636
* @param value the value to be associated with the specified key
3737
* @param ttl the time to live for the entry
3838
* @param unit the time unit of the ttl argument
39-
* @param actionWhenExpired the action to be performed when the entry expires
39+
* @param actionWhenExpired the action to be performed when the entry expires. Pass java.util.function.BiConsumer that receives key and values as its inputs
4040
* @throws NullPointerException if the key or unit is null
4141
*
4242
* @implNote If ttl is negative, the entry is considered non-expiring.
@@ -48,7 +48,7 @@ public void put(K key, V value, long ttl, TimeUnit unit, BiConsumer<K, V> action
4848
Entry<K, V> entry = new Entry<>(key, value, ttl, unit);
4949
map.put(key, entry);
5050
/*
51-
if ttl is negative then entry is cosidered non expiring
51+
if ttl is negative then entry is considered non expiring
5252
* */
5353
if(ttl >= 0) {
5454
setRemovalSchedule(entry,actionWhenExpired);

0 commit comments

Comments
 (0)