Module is.codion.framework.domain
Interface Attribute.AttributeDefiner<T>
- Type Parameters:
T
- the column type
- All Known Subinterfaces:
Column.ColumnDefiner<T>
,ForeignKey.ForeignKeyDefiner
public static interface Attribute.AttributeDefiner<T>
Provides
AttributeDefinition.Builder
instances.-
Method Summary
Modifier and TypeMethodDescription<B extends TransientAttributeDefinition.Builder<T,
B>>
TransientAttributeDefinition.Builder<T,B> Creates a newTransientAttributeDefinition.Builder
instance, which does not map to an underlying table column.<B extends DerivedAttributeDefinition.Builder<T,
B>>
DerivedAttributeDefinition.Builder<T,B> denormalized
(Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute) Instantiates aDerivedAttributeDefinition.Builder
instance, for displaying a value from a referenced entity attribute.<B extends DerivedAttributeDefinition.Builder<T,
B>>
DerivedAttributeDefinition.Builder<T,B> derived
(DerivedAttribute.Provider<T> valueProvider, Attribute<?>... sourceAttributes) Instantiates aDerivedAttributeDefinition.Builder
instance, which value is derived from one or more source attributes.
-
Method Details
-
attribute
<B extends TransientAttributeDefinition.Builder<T,B>> TransientAttributeDefinition.Builder<T,B> attribute()Creates a newTransientAttributeDefinition.Builder
instance, which does not map to an underlying table column.- Type Parameters:
B
- the builder type- Returns:
- a new
TransientAttributeDefinition.Builder
-
denormalized
<B extends DerivedAttributeDefinition.Builder<T,B>> DerivedAttributeDefinition.Builder<T,B> denormalized(Attribute<Entity> entityAttribute, Attribute<T> denormalizedAttribute) Instantiates aDerivedAttributeDefinition.Builder
instance, for displaying a value from a referenced entity attribute.- Type Parameters:
B
- the builder type- Parameters:
entityAttribute
- the entity attribute from which this attribute gets its valuedenormalizedAttribute
- the attribute from the referenced entity, from which this attribute gets its value- Returns:
- a new
DerivedAttributeDefinition.Builder
-
derived
<B extends DerivedAttributeDefinition.Builder<T,B>> DerivedAttributeDefinition.Builder<T,B> derived(DerivedAttribute.Provider<T> valueProvider, Attribute<?>... sourceAttributes) Instantiates aDerivedAttributeDefinition.Builder
instance, which value is derived from one or more source attributes.- Type Parameters:
B
- the builder type- Parameters:
valueProvider
- aDerivedAttribute.Provider
instance responsible for deriving the valuesourceAttributes
- the attributes from which this attribute derives its value- Returns:
- a new
DerivedAttributeDefinition.Builder
- Throws:
IllegalArgumentException
- in case no source attributes are specified
-