com.kenshoo.pl.entity.FieldsValueMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity;
/**
* The interface of any field -> value collection.
*/
public interface FieldsValueMap> {
/**
* Returns true
is the map has a value for the given field
*/
boolean containsField(EntityField field);
/**
* Returns the value of the specified field.
*
* @param field field to query
* @param type of the field
* @return the value of the field. Can be null
.
* @throws RuntimeException if the field is not present in the map
*/
T get(EntityField field);
/**
* @param field field whose value should be fetched
* @param the type of the value in the field
* @return the field value if not-null
; or Triptional.nullInstance()
if null
; or Triptional.absent()
if the field doesn't exist
*/
default Triptional safeGet(final EntityField field) {
if (containsField(field)) {
return Triptional.of(get(field));
}
return Triptional.absent();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy