} else {
return new TransientCacheEntry(ice.getKey(), ice.getValue(), maxIdle, timeService.wallClockTime());
}
} else {
if (maxIdle < 0) {
return new MortalCacheEntry(ice.getKey(), ice.getValue(), lifespan, timeService.wallClockTime());
} else {
long ctm = timeService.wallClockTime();
return new TransientMortalCacheEntry(ice.getKey(), ice.getValue(), maxIdle, lifespan, ctm, ctm);
}
}
} else if (ice instanceof MortalCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new ImmortalCacheEntry(ice.getKey(), ice.getValue());
} else {
return new TransientCacheEntry(ice.getKey(), ice.getValue(), maxIdle, timeService.wallClockTime());
}
} else {
if (maxIdle < 0) {
((MortalCacheEntry) ice).setLifespan(lifespan);
return ice;
} else {
long ctm = timeService.wallClockTime();
return new TransientMortalCacheEntry(ice.getKey(), ice.getValue(), maxIdle, lifespan, ctm, ctm);
}
}
} else if (ice instanceof TransientCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new ImmortalCacheEntry(ice.getKey(), ice.getValue());
} else {
((TransientCacheEntry) ice).setMaxIdle(maxIdle);
return ice;
}
} else {
if (maxIdle < 0) {
return new MortalCacheEntry(ice.getKey(), ice.getValue(), lifespan, timeService.wallClockTime());
} else {
long ctm = timeService.wallClockTime();
return new TransientMortalCacheEntry(ice.getKey(), ice.getValue(), maxIdle, lifespan, ctm, ctm);
}
}
} else if (ice instanceof TransientMortalCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new ImmortalCacheEntry(ice.getKey(), ice.getValue());
} else {
return new TransientCacheEntry(ice.getKey(), ice.getValue(), maxIdle, timeService.wallClockTime());
}
} else {
if (maxIdle < 0) {
return new MortalCacheEntry(ice.getKey(), ice.getValue(), lifespan, timeService.wallClockTime());
} else {
TransientMortalCacheEntry transientMortalEntry = (TransientMortalCacheEntry) ice;
transientMortalEntry.setLifespan(lifespan);
transientMortalEntry.setMaxIdle(maxIdle);
return ice;