All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kenshoo.pl.entity.Entity Maven / Gradle / Ivy

Go to download

A Java persistence layer based on JOOQ for high performance and business flow support.

There is a newer version: 0.1.121-jooq-3.16.3
Show newest version
package com.kenshoo.pl.entity;

import java.util.List;

import static java.util.Collections.emptyList;

public interface Entity {

    boolean containsField(EntityField field);

     T get(EntityField field);

    /**
     * @param field the field whose value should be fetched
     * @param  the type of 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();
    }

    default > List> getMany(E type) {
        return emptyList();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy