org.wildfly.clustering.ejb.cache.bean.BeanMetaDataEntryFunction Maven / Gradle / Ivy
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.ejb.cache.bean;
import java.time.Instant;
import java.util.function.Supplier;
import org.wildfly.clustering.cache.function.RemappingFunction;
import org.wildfly.clustering.server.offset.Offset;
import org.wildfly.clustering.server.offset.OffsetValue;
import org.wildfly.common.function.Functions;
/**
* Remapping function for a bean metadata entry.
* @author Paul Ferraro
*/
public class BeanMetaDataEntryFunction extends RemappingFunction, Supplier>> {
public BeanMetaDataEntryFunction(OffsetValue lastAccess) {
super(lastAccess::getOffset);
}
BeanMetaDataEntryFunction(Offset lastAccessOffset) {
super(Functions.constantSupplier(lastAccessOffset));
}
public Offset getOffset() {
return super.getOperand().get();
}
}