Module is.codion.framework.domain
Interface Entity.Builder
- Enclosing interface:
- Entity
public static interface Entity.Builder
A builder for
Entity
instances.
Store domain = new Store();
Entities entities = domain.entities();
Entity customer = entities.builder(Customer.TYPE)
.with(Customer.FIRST_NAME, "John")
.with(Customer.LAST_NAME, "Doe")
.build();
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the Entity instance<T> Entity.Builder
Adds the given attribute value to this builderSets the default value for all attributes which have a default value.
-
Method Details
-
with
Adds the given attribute value to this builder- Type Parameters:
T
- the value type- Parameters:
attribute
- the attributevalue
- the value- Returns:
- this builder instance
-
withDefaults
Entity.Builder withDefaults()Sets the default value for all attributes which have a default value.- Returns:
- this builder instance
- See Also:
-
build
Entity build()Builds the Entity instance- Returns:
- a new Entity instance
-