com.nimbusds.infinispan.persistence.ldap.InfinispanEntry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-ldap-cache-store Show documentation
Show all versions of infinispan-ldap-cache-store Show documentation
Infinispan module for persisting cache data to an LDAPv3 directory
package com.nimbusds.infinispan.persistence.ldap;
import net.jcip.annotations.Immutable;
import org.infinispan.metadata.InternalMetadata;
/**
* Encapsulates an Infinispan entry consisting of a key / value pair and
* associated optional metadata.
*/
@Immutable
public final class InfinispanEntry {
/**
* The entry key.
*/
private final K key;
/**
* The entry value.
*/
private final V value;
/**
* The optional entry metadata.
*/
private final InternalMetadata metadata;
/**
* Creates a new Infinispan entry.
*
* @param key The entry key. Must not be {@code null}.
* @param value The entry value. {@code null} if none.
* @param metadata Optional entry metadata, {@code null} if not
* specified.
*/
public InfinispanEntry(K key, V value, InternalMetadata metadata) {
assert key != null;
this.key = key;
this.value = value;
this.metadata = metadata;
}
/**
* Returns the entry key.
*
* @return The key.
*/
public K getKey() {
return key;
}
/**
* Returns the entry value.
*
* @return The value, {@code null} if none.
*/
public V getValue() {
return value;
}
/**
* Returns the optional entry metadata.
*
* @return The entry metadata, {@code null} if not specified.
*/
public InternalMetadata getMetadata() {
return metadata;
}
}