Class AbstractWritableAttributesBuilder<T extends com.foreach.across.core.support.ReadableAttributes>

java.lang.Object
com.foreach.across.modules.entity.config.builders.AbstractWritableAttributesBuilder<T>
Direct Known Subclasses:
AbstractWritableAttributesAndViewsBuilder, EntityPropertyDescriptorBuilder, EntityViewFactoryBuilder

public abstract class AbstractWritableAttributesBuilder<T extends com.foreach.across.core.support.ReadableAttributes> extends Object
Support class for builders building types that implement WritableAttributes. Allows setting of attribute values.
Since:
2.0.0
Author:
Arne Vandamme
  • Constructor Details

    • AbstractWritableAttributesBuilder

      public AbstractWritableAttributesBuilder()
  • Method Details

    • attribute

      public AbstractWritableAttributesBuilder attribute(@NonNull @NonNull String name, Object value)
      Add a custom attribute this builder should add to the entity.
      Parameters:
      name - Name of the attribute.
      value - Value of the attribute.
      Returns:
      current builder
    • attribute

      public <S> AbstractWritableAttributesBuilder attribute(@NonNull @NonNull Class<S> type, S value)
      Add a custom attribute this builder should add to the entity.
      Type Parameters:
      S - Class that is both key and value type of the attribute
      Parameters:
      type - Type of the attribute.
      value - Value of the attribute.
      Returns:
      current builder
    • attribute

      public AbstractWritableAttributesBuilder attribute(@NonNull @NonNull AttributeRegistrar<T> attributeRegistrar)
      Add an attribute registrar for one or more attributes that should be added. Provides a mechanism to get the owner (eg. EntityConfiguration...) to be made accessible to the attribute values.
      Parameters:
      attributeRegistrar - registrar
      Returns:
      current builder
    • applyAttributes

      protected void applyAttributes(T owner, com.foreach.across.core.support.WritableAttributes attributes)
    • getAttributes

      protected Map<String,Object> getAttributes()