Package com.blazebit.persistence.view
Interface EntityViewBuilderBase<T,X extends EntityViewBuilderBase<T,X>>
- Type Parameters:
T
- The entity view type that is builtX
- 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 Summary
Modifier and Type Method Description <E> E
get(int parameterIndex)
Returns the value for the given constructor parameter.<C> C
get(PluralAttribute<T,C,?> attribute)
Returns the value for the given attribute.<E> E
get(SingularAttribute<T,E> attribute)
Returns the value for the given attribute.<E> E
get(String attribute)
Returns the value for the given attribute.X
with(int parameterIndex, Object value)
Sets the given value for the given constructor parameter.<C> X
with(PluralAttribute<T,C,?> attribute, C value)
Sets the given value for the attribute.<E> X
with(SingularAttribute<T,E> attribute, E value)
Sets the given value for the attribute.X
with(String attribute, Object value)
Sets the given value for the given attribute.<E> EntityViewNestedBuilder<E,X>
withBuilder(CollectionAttribute<T,E> attribute)
Starts and returns a nested entity view builder for the given Collection attribute.<E> EntityViewNestedBuilder<E,X>
withBuilder(ListAttribute<T,E> attribute)
Starts and returns a nested entity view builder for the given List attribute.<E> EntityViewNestedBuilder<E,X>
withBuilder(ListAttribute<T,E> attribute, int index)
Starts and returns a nested entity view builder for the given List attribute.<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.<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.<E> EntityViewNestedBuilder<E,X>
withBuilder(SetAttribute<T,E> attribute)
Starts and returns a nested entity view builder for the Set attribute.<E> EntityViewNestedBuilder<E,X>
withBuilder(SingularAttribute<T,E> attribute)
Starts and returns a nested entity view builder for the given singular attribute.<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.<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.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.<E> X
withElement(CollectionAttribute<T,E> attribute, E value)
Adds the given value as element to the Collection for the given attribute.<E> X
withElement(ListAttribute<T,E> attribute, E value)
Adds the given value as element to the List for the given attribute.<E> X
withElement(SetAttribute<T,E> attribute, E value)
Adds the given value as element to the Set for the given attribute.X
withElement(String attribute, Object value)
Adds the given value as element to the Collection, Set or List attribute for the given attribute name.X
withEntry(int parameterIndex, Object key, Object value)
Adds the given key and value to the Map attribute for the given constructor parameter index.<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.X
withEntry(String attribute, Object key, Object value)
Adds the given key and value to the Map attribute for the given attribute name.<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.<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.<E> EntityViewNestedBuilder<E,X>
withListBuilder(String attribute)
Starts and returns a nested entity view builder for the List attribute for the given attribute name.<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.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.<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.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.<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.<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.<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.<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.<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.<E> EntityViewNestedBuilder<E,X>
withSetBuilder(String attribute)
Starts and returns a nested entity view builder for the Set attribute for the given attribute name.<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.<E> EntityViewNestedBuilder<E,X>
withSingularBuilder(String attribute)
Starts and returns a nested entity view builder for the singular attribute for the given attribute name.
-
Method Details
-
with
Sets the given value for the given attribute.- Parameters:
attribute
- The attribute namevalue
- The value- Returns:
- this builder for chaining
-
with
Sets the given value for the given constructor parameter.- Parameters:
parameterIndex
- The constructor parameter indexvalue
- The value- Returns:
- this builder for chaining
-
with
Sets the given value for the attribute.- Type Parameters:
E
- The attribute type- Parameters:
attribute
- The singular attributevalue
- The value- Returns:
- this builder for chaining
-
with
Sets the given value for the attribute.- Type Parameters:
C
- The attribute type- Parameters:
attribute
- The singular attributevalue
- The value- Returns:
- this builder for chaining
-
get
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
Returns the value for the given attribute.- Type Parameters:
E
- The attribute type- Parameters:
attribute
- The attribute- Returns:
- The value
-
get
Returns the value for the given attribute.- Type Parameters:
C
- The attribute type- Parameters:
attribute
- The attribute- Returns:
- The value
-
withElement
Adds the given value as element to the Collection, Set or List attribute for the given attribute name.- Parameters:
attribute
- The attribute namevalue
- The value- Returns:
- this builder for chaining
-
withElement
Adds the given value as element to the Collection, Set or List attribute for the given constructor parameter index.- Parameters:
parameterIndex
- The constructor parameter indexvalue
- The value- Returns:
- this builder for chaining
-
withListElement
Adds the given value as element at the given index to the List attribute for the given attribute name.- Parameters:
attribute
- The attribute nameindex
- The index at which to set the given valuevalue
- The value- Returns:
- this builder for chaining
-
withListElement
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 indexindex
- The index at which to set the given valuevalue
- The value- Returns:
- this builder for chaining
-
withEntry
Adds the given key and value to the Map attribute for the given attribute name.- Parameters:
attribute
- The attribute namekey
- The keyvalue
- The value- Returns:
- this builder for chaining
-
withEntry
Adds the given key and value to the Map attribute for the given constructor parameter index.- Parameters:
parameterIndex
- The constructor parameter indexkey
- The keyvalue
- The value- Returns:
- this builder for chaining
-
withElement
Adds the given value as element to the Collection for the given attribute.- Type Parameters:
E
- The element type- Parameters:
attribute
- The attributevalue
- The value- Returns:
- this builder for chaining
-
withElement
Adds the given value as element to the Set for the given attribute.- Type Parameters:
E
- The element type- Parameters:
attribute
- The attributevalue
- The value- Returns:
- this builder for chaining
-
withElement
Adds the given value as element to the List for the given attribute.- Type Parameters:
E
- The element type- Parameters:
attribute
- The attributevalue
- The value- Returns:
- this builder for chaining
-
withListElement
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 attributeindex
- The index at which to set the given valuevalue
- The value- Returns:
- this builder for chaining
-
withEntry
Sets the given value as element on the Map for the given key for the given attribute.- Type Parameters:
K
- The key typeV
- The element type- Parameters:
attribute
- The attributekey
- The key for which to set the given valuevalue
- The value- Returns:
- this builder for chaining
-
withSingularBuilder
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
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
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
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
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
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
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 nameindex
- The index in the list at which to set the element- Returns:
- the nested builder
-
withListBuilder
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 indexindex
- The index in the list at which to set the element- Returns:
- the nested builder
-
withSetBuilder
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
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
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 namekey
- The map key for which to set the element for- Returns:
- the nested builder
-
withMapBuilder
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 indexkey
- The map key for which to set the element for- Returns:
- the nested builder
-
withMapBuilder
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 typeV
- 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 typeV
- The element type- Parameters:
parameterIndex
- The constructor parameter index- Returns:
- the nested builder
-
withBuilder
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
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
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
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 attributeindex
- The index in the list at which to set the element- Returns:
- the nested builder
-
withBuilder
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
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 typeV
- The element type- Parameters:
attribute
- The attributekey
- 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 typeV
- The element type- Parameters:
attribute
- The attribute- Returns:
- the nested builder
-