Interface EntityViewBuilderBase<T,​X extends EntityViewBuilderBase<T,​X>>

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

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

    • with

      X 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

      X 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> X with​(SingularAttribute<T,​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> X with​(PluralAttribute<T,​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<T,​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<T,​C,​?> attribute)
      Returns the value for the given attribute.
      Type Parameters:
      C - The attribute type
      Parameters:
      attribute - The attribute
      Returns:
      The value
    • withElement

      X 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

      X 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

      X 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

      X 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

      X 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

      X 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> X withElement​(CollectionAttribute<T,​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> X withElement​(SetAttribute<T,​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> X withElement​(ListAttribute<T,​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> X withListElement​(ListAttribute<T,​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> X withEntry​(MapAttribute<T,​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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​X> 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,​EntityViewNestedBuilder<V,​X>> 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,​EntityViewNestedBuilder<V,​X>> 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,​X> withBuilder​(SingularAttribute<T,​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,​X> withBuilder​(CollectionAttribute<T,​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,​X> withBuilder​(ListAttribute<T,​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,​X> withBuilder​(ListAttribute<T,​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,​X> withBuilder​(SetAttribute<T,​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,​X> withBuilder​(MapAttribute<T,​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,​EntityViewNestedBuilder<V,​X>> withBuilder​(MapAttribute<T,​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