Skip to content

Commit

Permalink
javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
phlppchrtn committed Jan 9, 2024
1 parent 14a7137 commit 3d0e85c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@
package io.vertigo.core.node.definition;

/**
* This interface defines a Definition.
* The Definition interface defines an element that represents a part of the business or technical model.
* Each definition has a unique identifier, has a unique name which is composed of a specific prefix.
* Definitions are immutable, not serializable, and are loaded at boot time.
*
* Each element that defines a part of the business (or tech.) model is a definition.
*
* A definition
* - has an id (composed of a unique name, starting with a specific prefix)
* - is immutable
* - is not serializable.
* - is loaded at the boot.
*
* @author pchretien
* @author pchretien
*/
public interface Definition {
/**
* Gets the identifier of the definition.
*
* @return the unique identifier of the definition
*/
DefinitionId id();

/**
* Gets the name of the definition.
*
* @return the name of the definition
*/
default String getName() {
return id().fullName();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,45 @@
import java.util.Set;

/**
* Espace de définitions (non threadSafe).
* @author mlaroche
* DefinitionSpace represents a space for managing and resolving definitions.
* It is not thread-safe.
* Definitions within this space can be checked, resolved, and retrieved based on their names and types.
*
* @author mlaroche
*/
public interface DefinitionSpace {

/**
* Returns true if this container contains the specified definition
* @param name the name of the expected definition
* @return true if the definition is already registered.
* Checks if this container contains a definition with the specified name.
*
* @param name the name of the definition to check
* @return true if the definition is already registered, false otherwise
*/
boolean contains(String name);

/**
* Resolve a definition from its name and class.
* @param name the name of the expected definition
* @param clazz Type of the definition
* @return the definition
* Resolves a definition from its name and class type.
*
* @param <D> Type of the definition
* @param name the name of the definition to resolve
* @param clazz the class type of the definition
* @return the resolved definition
*/
<D extends Definition> D resolve(String name, Class<D> clazz);

/**
* @return Liste de tous les types de définition gérés.
* Gets a list of all types of definitions managed within this space.
*
* @return a set of classes representing the types of definitions
*/
Set<Class<? extends Definition>> getAllTypes();

/**
* @return Ordered Set of all objects for a type defined by its class
* @param clazz Class of the definition
* @param <C> Type of the definition
* Gets an ordered set of all objects for a specified definition type.
*
* @param <C> Type of the definition
* @param clazz the class type of the definition
* @return an ordered set of all objects for the specified definition type
*/
<C extends Definition> Set<C> getAll(Class<C> clazz);
}

0 comments on commit 3d0e85c

Please sign in to comment.