org.wildfly.clustering.ejb.cache.bean.CompositeImmutableBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wildfly-clustering-ejb-cache Show documentation
Show all versions of wildfly-clustering-ejb-cache Show documentation
Contains code common to the wildfly-clustering-ejb-hotrod and wildfly-clustering-ejb-infinispan modules.
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.clustering.ejb.cache.bean;
import org.wildfly.clustering.ejb.bean.BeanInstance;
import org.wildfly.clustering.ejb.bean.ImmutableBean;
import org.wildfly.clustering.ejb.bean.ImmutableBeanMetaData;
/**
* A {@link ImmutableBean} implementation composed from a {@link BeanInstance} and an {@link ImmutableBeanMetaData}.
* @author Paul Ferraro
* @param the bean identifier type
* @param the bean instance type
*/
public class CompositeImmutableBean> implements ImmutableBean {
private final K id;
private final V instance;
private final ImmutableBeanMetaData metaData;
public CompositeImmutableBean(K id, V instance, ImmutableBeanMetaData metaData) {
this.id = id;
this.instance = instance;
this.metaData = metaData;
}
@Override
public K getId() {
return this.id;
}
@Override
public V getInstance() {
return this.instance;
}
@Override
public ImmutableBeanMetaData getMetaData() {
return this.metaData;
}
}