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

org.seedstack.business.domain.IdentityService Maven / Gradle / Ivy

/*
 * Copyright © 2013-2024, The SeedStack authors 
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.seedstack.business.domain;

/**
 * IdentityService provides the ability to generate an identity using an {@link IdentityGenerator}
 * and inject it in the specified entity.
 *
 * @see IdentityGenerator
 */
public interface IdentityService {

    /**
     * Identifies the given entity.
     *
     * @param entity the entity to identify.
     * @param     the entity type.
     * @param     the entity key type.
     * @return the identified entity.
     * @throws IdentityExistsException if the entity already has an identity.
     */
    , I> E identify(E entity) throws IdentityExistsException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy