}
}
} else if (ice instanceof MetadataMortalCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new MetadataImmortalCacheEntry(ice.getKey(), ice.getValue(), metadata);
} else {
return new MetadataTransientCacheEntry(ice.getKey(), ice.getValue(), metadata, timeService.wallClockTime());
}
} else {
if (maxIdle < 0) {
ice.setMetadata(metadata);
return ice;
} else {
long ctm = timeService.wallClockTime();
return new MetadataTransientMortalCacheEntry(ice.getKey(), ice.getValue(), metadata, ctm, ctm);
}
}
} else if (ice instanceof MetadataTransientCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new MetadataImmortalCacheEntry(ice.getKey(), ice.getValue(), metadata);
} else {
ice.setMetadata(metadata);
return ice;
}
} else {
if (maxIdle < 0) {
return new MetadataMortalCacheEntry(ice.getKey(), ice.getValue(), metadata, timeService.wallClockTime());
} else {
long ctm = timeService.wallClockTime();
return new MetadataTransientMortalCacheEntry(ice.getKey(), ice.getValue(), metadata, ctm, ctm);
}
}
} else if (ice instanceof MetadataTransientMortalCacheEntry) {
if (lifespan < 0) {
if (maxIdle < 0) {
return new MetadataImmortalCacheEntry(ice.getKey(), ice.getValue(), metadata);
} else {
return new MetadataTransientCacheEntry(ice.getKey(), ice.getValue(), metadata, maxIdle);
}
} else {
if (maxIdle < 0) {