Module is.codion.framework.domain
Interface EntityDefinition.Attributes
- Enclosing interface:
EntityDefinition
public static sealed interface EntityDefinition.Attributes
Holds the attribute definitions for an entity type
-
Method Summary
Modifier and TypeMethodDescriptionboolean<T> AttributeDefinition<T> definition(Attribute<T> attribute) <T> Collection<Attribute<?>> derivedFrom(Attribute<T> attribute) Returns the attributes which values are derived from the value of the given attribute, an empty collection if no such derived attributes existCollection<Attribute<?>> get()Returns the attribute with the given name, null if none is found.<T> Attribute<T> getOrThrow(String attributeName) Returns the attribute with the given name.Collection<Attribute<?>> selected()Returns the attributes selected by default for this entity type.
-
Method Details
-
get
Collection<Attribute<?>> get()- Returns:
- all attributes for this entity type
-
definitions
Collection<AttributeDefinition<?>> definitions()- Returns:
- an unmodifiable view of the attribute definitions
-
derivedFrom
Returns the attributes which values are derived from the value of the given attribute, an empty collection if no such derived attributes exist- Type Parameters:
T- the attribute type- Parameters:
attribute- the attribute- Returns:
- a collection containing the attributes which are derived from the given attribute
-
contains
- Parameters:
attribute- the attribute- Returns:
- true if this entity definition contains the given attribute
-
get
Returns the attribute with the given name, null if none is found.- Type Parameters:
T- the attribute type- Parameters:
attributeName- the name of the attribute to fetch- Returns:
- the attribute with the given name, null if none is found
-
getOrThrow
Returns the attribute with the given name.- Type Parameters:
T- the attribute type- Parameters:
attributeName- the name of the attribute to fetch- Returns:
- the attribute with the given name
- Throws:
IllegalArgumentException- in case the attribute was not found
-
selected
Collection<Attribute<?>> selected()Returns the attributes selected by default for this entity type. Contains the selectable columns and foreign keys, excluding lazy loaded columns and foreign keys based on lazy loaded columns.- Returns:
- the default select attributes
- See Also:
-
definition
- Type Parameters:
T- the attribute type- Parameters:
attribute- the attribute- Returns:
- the attribute definition associated with
attribute. - Throws:
IllegalArgumentException- in case no such attribute existsNullPointerException- in caseattributeis null
-