initial import

This commit is contained in:
2026-05-11 19:59:10 +07:00
commit 582353e277
479 changed files with 32418 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.cmobile.unifiedtms.entity.misc;
public class ExpirableObject<T> {
private long storageTime = -1L;
private long expiryTime = -1L;
private T object;
public ExpirableObject(T object, long expiryTime) {
this.object = object;
this.expiryTime = expiryTime;
this.storageTime = System.currentTimeMillis();
}
public T getObject() {
if(!isExpired()) {
return object;
}
return null;
}
public boolean isExpired() {
long current = System.currentTimeMillis();
return (current > (this.storageTime + this.expiryTime));
}
}