Package com.blazebit.persistence.view
Interface EntityViewBuilderBase<ViewType,BuilderType extends EntityViewBuilderBase<ViewType,BuilderType>>
- Type Parameters:
ViewType
- The entity view type that is builtBuilderType
- 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 Summary
Modifier and Type Method Description <E> E
get(int parameterIndex)
Returns the value for the given constructor parameter.<C> C
get(PluralAttribute<ViewType,C,?> attribute)
Returns the value for the given attribute.<E> E
get(SingularAttribute<ViewType,E> attribute)
Returns the value for the given attribute.<E> E
get(String attribute)
Returns the value for the given attribute.BuilderType
with(int parameterIndex, Object value)
Sets the given value for the given constructor parameter.<C> BuilderType
with(PluralAttribute<ViewType,C,?> attribute, C value)
Sets the given value for the attribute.<E> BuilderType
with(SingularAttribute<ViewType,E> attribute, E value)
Sets the given value for the attribute.BuilderType
with(String attribute, Object value)
Sets the given value for the given attribute.<E> EntityViewNestedBuilder<E,? extends BuilderType,?>
withBuilder(CollectionAttribute<ViewType,E> attribute)
Starts and returns a nested entity view builder for the given Collection attribute.<E> EntityViewNestedBuilder<E,? extends BuilderType,?>
withBuilder(ListAttribute<ViewType,E> attribute)
Starts and returns a nested entity view builder for the given List attribute.<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.<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.<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.<E> EntityViewNestedBuilder<E,? extends BuilderType,?>
withBuilder(SetAttribute<ViewType,E> attribute)
Starts and returns a nested entity view builder for the Set attribute.<E> EntityViewNestedBuilder<E,? extends BuilderType,?>
withBuilder(SingularAttribute<ViewType,E> attribute)
Starts and returns a nested entity view builder for the given singular attribute.<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.<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.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.<E> BuilderType
withElement(CollectionAttribute<ViewType,E> attribute, E value)
Adds the given value as element to the Collection for the given attribute.<E> BuilderType
withElement(ListAttribute<ViewType,E> attribute, E value)
Adds the given value as element to the List for the given attribute.<E> BuilderType
withElement(SetAttribute<ViewType,E> attribute, E value)
Adds the given value as element to the Set for the given attribute.BuilderType
withElement(String attribute, Object value)
Adds the given value as element to the Collection, Set or List attribute for the given attribute name.BuilderType
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> 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.BuilderType
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,? extends BuilderType,?>
withListBuilder(int parameterIndex)
Starts and returns a nested entity view builder for the List attribute for the given constructor parameter index.<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.<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.<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.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.<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.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.<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.<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.<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.<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.<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.<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.<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.<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.
-
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
<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 nameindex
- 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 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
<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 namekey
- 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 indexkey
- 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 typeV
- 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 typeV
- 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 attributeindex
- 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 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,? 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 typeV
- The element type- Parameters:
attribute
- The attribute- Returns:
- the nested builder
-