Interface EntityViewBuilderBase<ViewType,​BuilderType extends EntityViewBuilderBase<ViewType,​BuilderType>>

Type Parameters:
ViewType - The entity view type that is built
BuilderType - The entity view builder type
All Known Subinterfaces:
EntityViewBuilder<ViewType>, EntityViewNestedBuilder<ViewType,​ResultType,​BuilderType>

public interface EntityViewBuilderBase<ViewType,​BuilderType extends EntityViewBuilderBase<ViewType,​BuilderType>>
A builder for creating an entity view.
Since:
1.5.0
Author:
Christian Beikov
  • Method Details

    • with

      BuilderType with​(String attribute, Object value)
      Sets the given value for the given attribute.
      Parameters:
      attribute - The attribute name
      value - The value
      Returns:
      this builder for chaining
    • with

      BuilderType with​(int parameterIndex, Object value)
      Sets the given value for the given constructor parameter.
      Parameters:
      parameterIndex - The constructor parameter index
      value - The value
      Returns:
      this builder for chaining
    • with

      <E> BuilderType with​(SingularAttribute<ViewType,​E> attribute, E value)
      Sets the given value for the attribute.
      Type Parameters:
      E - The attribute type
      Parameters:
      attribute - The singular attribute
      value - The value
      Returns:
      this builder for chaining
    • with

      <C> BuilderType with​(PluralAttribute<ViewType,​C,​?> attribute, C value)
      Sets the given value for the attribute.
      Type Parameters:
      C - The attribute type
      Parameters:
      attribute - The singular attribute
      value - The value
      Returns:
      this builder for chaining
    • get

      <E> E get​(String attribute)
      Returns the value for the given attribute.
      Type Parameters:
      E - The attribute type
      Parameters:
      attribute - The attribute name
      Returns:
      the value for the attribute
    • get

      <E> E get​(int parameterIndex)
      Returns the value for the given constructor parameter.
      Type Parameters:
      E - The attribute type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the value for the constructor parameter
    • get

      <E> E get​(SingularAttribute<ViewType,​E> attribute)
      Returns the value for the given attribute.
      Type Parameters:
      E - The attribute type
      Parameters:
      attribute - The attribute
      Returns:
      The value
    • get

      <C> C get​(PluralAttribute<ViewType,​C,​?> attribute)
      Returns the value for the given attribute.
      Type Parameters:
      C - The attribute type
      Parameters:
      attribute - The attribute
      Returns:
      The value
    • withElement

      BuilderType withElement​(String attribute, Object value)
      Adds the given value as element to the Collection, Set or List attribute for the given attribute name.
      Parameters:
      attribute - The attribute name
      value - The value
      Returns:
      this builder for chaining
    • withElement

      BuilderType withElement​(int parameterIndex, Object value)
      Adds the given value as element to the Collection, Set or List attribute for the given constructor parameter index.
      Parameters:
      parameterIndex - The constructor parameter index
      value - The value
      Returns:
      this builder for chaining
    • withListElement

      BuilderType withListElement​(String attribute, int index, Object value)
      Adds the given value as element at the given index to the List attribute for the given attribute name.
      Parameters:
      attribute - The attribute name
      index - The index at which to set the given value
      value - The value
      Returns:
      this builder for chaining
    • withListElement

      BuilderType withListElement​(int parameterIndex, int index, Object value)
      Adds the given value as element at the given index to the List attribute for the given constructor parameter index.
      Parameters:
      parameterIndex - The constructor parameter index
      index - The index at which to set the given value
      value - The value
      Returns:
      this builder for chaining
    • withEntry

      BuilderType withEntry​(String attribute, Object key, Object value)
      Adds the given key and value to the Map attribute for the given attribute name.
      Parameters:
      attribute - The attribute name
      key - The key
      value - The value
      Returns:
      this builder for chaining
    • withEntry

      BuilderType withEntry​(int parameterIndex, Object key, Object value)
      Adds the given key and value to the Map attribute for the given constructor parameter index.
      Parameters:
      parameterIndex - The constructor parameter index
      key - The key
      value - The value
      Returns:
      this builder for chaining
    • withElement

      <E> BuilderType withElement​(CollectionAttribute<ViewType,​E> attribute, E value)
      Adds the given value as element to the Collection for the given attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      value - The value
      Returns:
      this builder for chaining
    • withElement

      <E> BuilderType withElement​(SetAttribute<ViewType,​E> attribute, E value)
      Adds the given value as element to the Set for the given attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      value - The value
      Returns:
      this builder for chaining
    • withElement

      <E> BuilderType withElement​(ListAttribute<ViewType,​E> attribute, E value)
      Adds the given value as element to the List for the given attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      value - The value
      Returns:
      this builder for chaining
    • withListElement

      <E> BuilderType withListElement​(ListAttribute<ViewType,​E> attribute, int index, E value)
      Sets the given value as element on the List at the given index for the given attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      index - The index at which to set the given value
      value - The value
      Returns:
      this builder for chaining
    • withEntry

      <K,​ V> BuilderType withEntry​(MapAttribute<ViewType,​K,​V> attribute, K key, V value)
      Sets the given value as element on the Map for the given key for the given attribute.
      Type Parameters:
      K - The key type
      V - The element type
      Parameters:
      attribute - The attribute
      key - The key for which to set the given value
      value - The value
      Returns:
      this builder for chaining
    • withSingularBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withSingularBuilder​(String attribute)
      Starts and returns a nested entity view builder for the singular attribute for the given attribute name.
      Type Parameters:
      E - The attribute type
      Parameters:
      attribute - The attribute name
      Returns:
      the nested builder
    • withSingularBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withSingularBuilder​(int parameterIndex)
      Starts and returns a nested entity view builder for the singular attribute for the given constructor parameter index.
      Type Parameters:
      E - The attribute type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the nested builder
    • withCollectionBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withCollectionBuilder​(String attribute)
      Starts and returns a nested entity view builder for the Collection, Set or List attribute for the given attribute name.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute name
      Returns:
      the nested builder
    • withCollectionBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withCollectionBuilder​(int parameterIndex)
      Starts and returns a nested entity view builder for the Collection, Set or List attribute for the given constructor parameter index.
      Type Parameters:
      E - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the nested builder
    • withListBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withListBuilder​(String attribute)
      Starts and returns a nested entity view builder for the List attribute for the given attribute name.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute name
      Returns:
      the nested builder
    • withListBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withListBuilder​(int parameterIndex)
      Starts and returns a nested entity view builder for the List attribute for the given constructor parameter index.
      Type Parameters:
      E - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the nested builder
    • withListBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withListBuilder​(String attribute, int index)
      Starts and returns a nested entity view builder for the List attribute for the given attribute name. After the nested builder is finished, the built object is added to the list at the given index.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute name
      index - The index in the list at which to set the element
      Returns:
      the nested builder
    • withListBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withListBuilder​(int parameterIndex, int index)
      Starts and returns a nested entity view builder for the List attribute for the given constructor parameter index. After the nested builder is finished, the built object is added to the list at the given index.
      Type Parameters:
      E - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      index - The index in the list at which to set the element
      Returns:
      the nested builder
    • withSetBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withSetBuilder​(String attribute)
      Starts and returns a nested entity view builder for the Set attribute for the given attribute name.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute name
      Returns:
      the nested builder
    • withSetBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withSetBuilder​(int parameterIndex)
      Starts and returns a nested entity view builder for the Set attribute for the given constructor parameter index.
      Type Parameters:
      E - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the nested builder
    • withMapBuilder

      <V> EntityViewNestedBuilder<V,​? extends BuilderType,​?> withMapBuilder​(String attribute, Object key)
      Starts and returns a nested entity view builder for the Map attribute for the given attribute name. After the nested builder is finished, the built object is put into the map with the given key.
      Type Parameters:
      V - The element type
      Parameters:
      attribute - The attribute name
      key - The map key for which to set the element for
      Returns:
      the nested builder
    • withMapBuilder

      <V> EntityViewNestedBuilder<V,​? extends BuilderType,​?> withMapBuilder​(int parameterIndex, Object key)
      Starts and returns a nested entity view builder for the Map attribute for the given constructor parameter index. After the nested builder is finished, the built object is put into the map with the given key.
      Type Parameters:
      V - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      key - The map key for which to set the element for
      Returns:
      the nested builder
    • withMapBuilder

      <K,​ V> EntityViewNestedBuilder<K,​? extends EntityViewNestedBuilder<V,​? extends BuilderType,​?>,​?> withMapBuilder​(String attribute)
      Starts and returns a nested entity view builder for the Map attribute for the given attribute name. The returned builder is for the key subview. The builder returned by that, is for the value subview.
      Type Parameters:
      K - The key type
      V - The element type
      Parameters:
      attribute - The attribute name
      Returns:
      the nested builder
    • withMapBuilder

      <K,​ V> EntityViewNestedBuilder<K,​? extends EntityViewNestedBuilder<V,​? extends BuilderType,​?>,​?> withMapBuilder​(int parameterIndex)
      Starts and returns a nested entity view builder for the Map attribute for the given constructor parameter index. The returned builder is for the key subview. The builder returned by that, is for the value subview.
      Type Parameters:
      K - The key type
      V - The element type
      Parameters:
      parameterIndex - The constructor parameter index
      Returns:
      the nested builder
    • withBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withBuilder​(SingularAttribute<ViewType,​E> attribute)
      Starts and returns a nested entity view builder for the given singular attribute.
      Type Parameters:
      E - The attribute type
      Parameters:
      attribute - The attribute
      Returns:
      the nested builder
    • withBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withBuilder​(CollectionAttribute<ViewType,​E> attribute)
      Starts and returns a nested entity view builder for the given Collection attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      Returns:
      the nested builder
    • withBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withBuilder​(ListAttribute<ViewType,​E> attribute)
      Starts and returns a nested entity view builder for the given List attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      Returns:
      the nested builder
    • withBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withBuilder​(ListAttribute<ViewType,​E> attribute, int index)
      Starts and returns a nested entity view builder for the given List attribute. After the nested builder is finished, the built object is added to the list at the given index.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      index - The index in the list at which to set the element
      Returns:
      the nested builder
    • withBuilder

      <E> EntityViewNestedBuilder<E,​? extends BuilderType,​?> withBuilder​(SetAttribute<ViewType,​E> attribute)
      Starts and returns a nested entity view builder for the Set attribute.
      Type Parameters:
      E - The element type
      Parameters:
      attribute - The attribute
      Returns:
      the nested builder
    • withBuilder

      <K,​ V> EntityViewNestedBuilder<V,​? extends BuilderType,​?> withBuilder​(MapAttribute<ViewType,​K,​V> attribute, K key)
      Starts and returns a nested entity view builder for the given Map attribute. After the nested builder is finished, the built object is put into the map with the given key.
      Type Parameters:
      K - The key type
      V - The element type
      Parameters:
      attribute - The attribute
      key - The map key for which to set the element for
      Returns:
      the nested builder
    • withBuilder

      <K,​ V> EntityViewNestedBuilder<K,​? extends EntityViewNestedBuilder<V,​? extends BuilderType,​?>,​?> withBuilder​(MapAttribute<ViewType,​K,​V> attribute)
      Starts and returns a nested entity view builder for the given Map attribute. The returned builder is for the key subview. The builder returned by that, is for the value subview.
      Type Parameters:
      K - The key type
      V - The element type
      Parameters:
      attribute - The attribute
      Returns:
      the nested builder