Class EntitiesConfigurationBuilder

java.lang.Object
com.foreach.across.modules.entity.config.builders.EntitiesConfigurationBuilder

public class EntitiesConfigurationBuilder extends Object
Central builder for customizing configuration entries in the EntityRegistry.
Author:
Arne Vandamme
  • Method Details

    • register

      public <U> EntityConfigurationBuilder<U> register(@NonNull @NonNull Class<U> entityType)
      Configure a builder for a new EntityConfiguration for the class specified. This will automatically introspect the class and create the initial property registry. Use create() if you want a blank entity configuration builder.

      Note: functionally this is the same as calling withType(Class). This method is provided for readability to indicate explicit registration of a new type.

      Returns:
      configuration builder
      See Also:
    • create

      Configure a builder for a new EntityConfiguration. The EntityConfigurationBuilder will only be passed to this consumer and the consumer is expected to manually populate a valid entity configuration. If you want the default EntityConfigurationProvider to be called, you should use withType(Class) instead.
      Returns:
      configuration builder
    • withName

      public EntityConfigurationBuilder<Object> withName(String configurationName)
      Configure a builder for an EntityConfiguration with the specific name. If non-existing this method will create a new configuration. Unlike withType(Class) however, the new configuration will be entirely blank and will require all settings to be done manually.
      Parameters:
      configurationName - for which to configure the builder
      Returns:
      configuration builder
    • withType

      public <U> EntityConfigurationBuilder<U> withType(Class<U> entityType)
      Configure a builder for a specific entity type. If non-existing, this method will create a default EntityConfiguration with settings that could be detected based on the specific exact type of the entity.
      Parameters:
      entityType - for which to configure the builder
      Returns:
      configuration builder
    • all

      Configure a builder to apply to all configurations in the registry.
      Returns:
      configuration builder for all entity configurations
    • assignableTo

      public <U> EntityConfigurationBuilder<U> assignableTo(@NonNull @NonNull Class<U> entityType)
      Configure a builder to apply to all entities that can be assigned to the specific parent type or interface. Same as a call to matching(Predicate) with a predicate on entity type.
      Parameters:
      entityType - that entities can be assigned to
      Returns:
      entity builder instance
    • matching

      public EntityConfigurationBuilder<Object> matching(@NonNull @NonNull Predicate<MutableEntityConfiguration> configurationPredicate)
      Configure a builder to apply to all configurations matching the predicate.
      Parameters:
      configurationPredicate - predicate the configurations should match
      Returns:
      current builder