Package com.activeviam.builders
Class SimpleCubeDescriptionBuilder<DescriptionT>
- java.lang.Object
-
- com.activeviam.builders.SimpleCubeDescriptionBuilder<DescriptionT>
-
- Type Parameters:
DescriptionT- SeeICubeDescriptionBuilder.
- All Implemented Interfaces:
ICanHaveFactFilter,ICanStartBuildingEpochDimension<DescriptionT>,ICanStartBuildingDataCube,ICanAddSharedContextValue<DescriptionT>,ICanBuildCommonCubeDescription<DescriptionT>,ICanBuildCubeDescription<DescriptionT>,ICanStartBuildingAggregateProvider<DescriptionT>,ICubeDescriptionBuilder
public class SimpleCubeDescriptionBuilder<DescriptionT> extends Object implements ICubeDescriptionBuilder, ICanBuildCubeDescription<DescriptionT>
Simple implementation ofICubeDescriptionBuilder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.activeviam.desc.build.ICanBuildCommonCubeDescription
ICanBuildCommonCubeDescription.IAggregationProceduresBuilder
-
Nested classes/interfaces inherited from interface com.activeviam.desc.build.ICubeDescriptionBuilder
ICubeDescriptionBuilder.INamedCubeDescriptionBuilder
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SimpleCubeDescriptionBuilder(Function<IActivePivotInstanceDescription,DescriptionT> resultConsumer)Constructor for build start.
-
Method Summary
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.activeviam.desc.build.ICanAddSharedContextValue
withSharedContextValue
-
Methods inherited from interface com.activeviam.desc.build.ICanBuildCommonCubeDescription
withDefaultMeasure
-
Methods inherited from interface com.activeviam.desc.build.dimensions.ICanHaveFactFilter
withFilter
-
-
-
-
Field Detail
-
DEFAULT_AUTO_FACTLESS_HIERARCHIES
public static final boolean DEFAULT_AUTO_FACTLESS_HIERARCHIES
The default value forIActivePivotDescription.isAutoFactlessHierarchies()in the produced description.- See Also:
- Constant Field Values
-
DEFAULT_SLICING
public static final boolean DEFAULT_SLICING
The default value used to computeIHierarchyDescription.isAllMembersEnabled().- See Also:
- Constant Field Values
-
DEFAULT_VIRTUAL
public static final boolean DEFAULT_VIRTUAL
The default virtual value for a hierarchy.- See Also:
- Constant Field Values
-
DEFAULT_VISIBILITY
public static final boolean DEFAULT_VISIBILITY
The default visibility of built items.- See Also:
- Constant Field Values
-
DEFAULT_MEASURE_GROUPS
public static final String DEFAULT_MEASURE_GROUPS
The default value forIAxisDimensionDescription.getMeasureGroups()andIMeasureMemberDescription.getGroup().
-
DEFAULT_FOLDER
public static final String DEFAULT_FOLDER
The default value forIHierarchyDescription.getFolder()andIMeasureMemberDescription.getFolder().
-
DEFAULT_LEVEL_FORMATTER
public static final String DEFAULT_LEVEL_FORMATTER
The default value forIAxisLevelDescription.getFormatter().
-
DEFAULT_DIMENSION_TYPE
public static final IDimension.DimensionType DEFAULT_DIMENSION_TYPE
The default value forIAxisDimensionDescription.getDimensionType().
-
DEFAULT_LEVEL_TYPE
public static final ILevelInfo.LevelType DEFAULT_LEVEL_TYPE
The default value forIAxisLevelDescription.getLevelType().
-
DEFAULT_MEMBER_PROPERTIES
public static final ImmutableList<IPropertyInfo> DEFAULT_MEMBER_PROPERTIES
The default value forIAxisLevelDescription.getMemberProperties().
-
DEFAULT_PROPERTIES
public static final ImmutableMap<String,Object> DEFAULT_PROPERTIES
The default properties of built items.
-
-
Constructor Detail
-
SimpleCubeDescriptionBuilder
public SimpleCubeDescriptionBuilder(Function<IActivePivotInstanceDescription,DescriptionT> resultConsumer)
Constructor for build start.- Parameters:
resultConsumer- The function processing the builtIActivePivotInstanceDescriptiononbuild().
-
-
Method Detail
-
withResultConsumer
public <NewDescriptionT> SimpleCubeDescriptionBuilder<NewDescriptionT> withResultConsumer(Function<DescriptionT,NewDescriptionT> newResultConsumer)
Changes our result consumer by chaining a new one.- Type Parameters:
NewDescriptionT- The return type of the new result consumer.- Parameters:
newResultConsumer- The new result consumer to chain to our.- Returns:
- The new builder taking into account the new result consumer.
-
withDimension
public IDimensionBuilder withDimension(String name)
Starts building a dimension.- Parameters:
name- The name of the dimension.- Returns:
- The dimension builder.
-
withDimensions
public ICanBuildCubeDescription<IActivePivotInstanceDescription> withDimensions(ICanStartBuildingDimensions.DimensionsAdder adder)
Integrates the dimensions built by a separate function.- Parameters:
adder- The function adding the dimensions.- Returns:
- The builder having integrated the function changes.
-
withEpochDimension
public IEpochDimensionBuilder<DescriptionT> withEpochDimension()
Description copied from interface:ICanStartBuildingEpochDimensionEnables the epoch dimension for this cube and starts customizing it.- Specified by:
withEpochDimensionin interfaceICanStartBuildingEpochDimension<DescriptionT>- Returns:
- The builder to start customizing the epoch dimension.
-
withEpochDimension
public SimpleCubeDescriptionBuilder<DescriptionT> withEpochDimension(IEpochDimensionDescription newEpochDimension)
Changes the epoch dimension description to use in the cube.- Parameters:
newEpochDimension- The epoch dimension description.- Returns:
- The builder for chained calls.
-
addAggregationProcedure
public SimpleCubeDescriptionBuilder<DescriptionT> addAggregationProcedure(IAnalysisAggregationProcedureDescription aggregationProcedure)
Adds the description of anIAnalysisAggregationProcedureDescriptionto the cube description.- Parameters:
aggregationProcedure- procedure description- Returns:
- the updated builder
-
withAggregationProcedures
public ICanBuildCommonCubeDescription<DescriptionT> withAggregationProcedures(Function<ICanBuildCommonCubeDescription.IAggregationProceduresBuilder,ICanBuildCommonCubeDescription.IAggregationProceduresBuilder> builderConsumer)
Description copied from interface:ICanBuildCommonCubeDescriptionDefines aggregation procedures on the cube.Aggregation procedures offer means to support aggregated measures on analysis hierarchies.
- Specified by:
withAggregationProceduresin interfaceICanBuildCommonCubeDescription<DescriptionT>- Parameters:
builderConsumer- consumer of the builder to define the procedures- Returns:
- The builder for chained calls
-
addDimension
public SimpleCubeDescriptionBuilder<DescriptionT> addDimension(IAxisDimensionDescription description)
Adds the description for a dimension.- Parameters:
description- The description of the dimension.- Returns:
- The builder for chained calls.
-
withAggregatesCache
public IAggregatesCacheDescriptionCompleteBuilder.AggregatesCacheDescriptionBuilder<DescriptionT> withAggregatesCache()
Description copied from interface:ICanBuildCommonCubeDescriptionStarts building theIAggregatesCachedescription.- Specified by:
withAggregatesCachein interfaceICanBuildCommonCubeDescription<DescriptionT>- Returns:
- The builder for the aggregates cache.
-
asDataCube
public IDataCubeDescriptionBuilder asDataCube()
Starts converting this cube to a data cube.- Specified by:
asDataCubein interfaceICanStartBuildingDataCube- Returns:
- The data cube builder.
-
withName
public ICubeDescriptionBuilder.INamedCubeDescriptionBuilder withName(String newId)
Description copied from interface:ICubeDescriptionBuilderGives a name to the cube to build.- Specified by:
withNamein interfaceICubeDescriptionBuilder- Parameters:
newId- The cube name, a.k.a. id, a.k.a. pivotId.- Returns:
- The builder for chained calls.
-
build
public DescriptionT build()
Description copied from interface:ICanBuildCommonCubeDescriptionBuilds the cube description.- Specified by:
buildin interfaceICanBuildCommonCubeDescription<DescriptionT>- Returns:
- the cube description.
-
withAggregateProvider
public IBuildableAggregateProviderDescriptionBuilder.AggregateProviderBuilder<DescriptionT> withAggregateProvider()
Description copied from interface:ICanStartBuildingAggregateProviderStarts building the aggregate provider description.- Specified by:
withAggregateProviderin interfaceICanStartBuildingAggregateProvider<DescriptionT>- Returns:
- The aggregate provider description builder.
-
withAggregateProvider
public SimpleCubeDescriptionBuilder<DescriptionT> withAggregateProvider(IAggregateProviderDefinition definition)
Description copied from interface:ICanStartBuildingAggregateProviderProvide directly an aggregate provider description for this cube.- Specified by:
withAggregateProviderin interfaceICanStartBuildingAggregateProvider<DescriptionT>- Parameters:
definition- The aggregate provider definition.- Returns:
- The cube builder.
-
withDrillthroughExecutor
public IPluginDescriptionBuilder<ICanBuildCubeDescription<DescriptionT>> withDrillthroughExecutor()
Description copied from interface:ICanBuildCommonCubeDescriptionStarts building theIDrillthroughExecutordescription.- Specified by:
withDrillthroughExecutorin interfaceICanBuildCommonCubeDescription<DescriptionT>- Returns:
- The builder for the drillthrough executor description.
-
withQueryExecutor
public IPluginDescriptionBuilder<ICanBuildCubeDescription<DescriptionT>> withQueryExecutor()
Description copied from interface:ICanBuildCommonCubeDescriptionStarts building theIActivePivotQueryExecutordescription.- Specified by:
withQueryExecutorin interfaceICanBuildCommonCubeDescription<DescriptionT>- Returns:
- The builder for the query executor description.
-
withAggregatesContinuousQueryEngine
public IPluginDescriptionBuilder<ICanBuildCubeDescription<DescriptionT>> withAggregatesContinuousQueryEngine()
Description copied from interface:ICanBuildCommonCubeDescriptionStarts building theIAggregatesContinuousQueryEnginedescription.- Specified by:
withAggregatesContinuousQueryEnginein interfaceICanBuildCommonCubeDescription<DescriptionT>- Returns:
- The builder for the aggregates continuous query engine description.
-
withoutAutoFactlessHierarchies
public ICanBuildCubeDescription<DescriptionT> withoutAutoFactlessHierarchies()
Description copied from interface:ICanBuildCubeDescriptionDisables auto-factless hierarchies for this cube.- Specified by:
withoutAutoFactlessHierarchiesin interfaceICanBuildCubeDescription<DescriptionT>- Returns:
- The builder for chained calls.
-
withSharedContextValue
public ICanBuildCubeDescription<DescriptionT> withSharedContextValue(IContextValue value)
Description copied from interface:ICanAddSharedContextValueAdds a shared context value to the current cube description.- Specified by:
withSharedContextValuein interfaceICanAddSharedContextValue<DescriptionT>- Parameters:
value- The value to add to the cube shared context.- Returns:
- The builder for chained calls.
-
withSharedContextValues
public ICanBuildCubeDescription<DescriptionT> withSharedContextValues(IContextValue... values)
Description copied from interface:ICanAddSharedContextValueAdds a collection of shared context values to the cube description being currently built. This is sugar syntax for repetitive calls toICanAddSharedContextValue.withSharedContextValue(IContextValue).- Specified by:
withSharedContextValuesin interfaceICanAddSharedContextValue<DescriptionT>- Parameters:
values- the context values to add- Returns:
- The builder for chained calls.
-
withSharedMdxContext
public ICanStartBuildingMdxContext.IMdxContextBuilder<ICanBuildCubeDescription<DescriptionT>> withSharedMdxContext()
Description copied from interface:ICanAddSharedContextValueBegins defining themdx context.- Specified by:
withSharedMdxContextin interfaceICanAddSharedContextValue<DescriptionT>- Returns:
- this builder for chaining.
-
withSharedDrillthroughProperties
public ICanStartBuildingDrillthroughProperties.IDrillthroughPropertiesBuilder<ICanBuildCubeDescription<DescriptionT>> withSharedDrillthroughProperties()
Description copied from interface:ICanAddSharedContextValueBegins defining thedrillthrough properties.- Specified by:
withSharedDrillthroughPropertiesin interfaceICanAddSharedContextValue<DescriptionT>- Returns:
- this builder for chaining.
-
withSharedSubCubeProperties
public ICanStartBuildingSubCubeProperties.IEmptyBuilder<ICanBuildCubeDescription<DescriptionT>> withSharedSubCubeProperties()
Description copied from interface:ICanAddSharedContextValueBegins definingsub cube properties.- Specified by:
withSharedSubCubePropertiesin interfaceICanAddSharedContextValue<DescriptionT>- Returns:
- this builder for chaining.
-
withFilter
public ICanBuildCubeDescription<IActivePivotInstanceDescription> withFilter(ICondition condition)
Description copied from interface:ICanHaveFactFilterDefines thefilter conditionfor the cube.- Specified by:
withFilterin interfaceICanHaveFactFilter- Parameters:
condition- The condition of the filter.- Returns:
- The cube builder for chaining.
-
withDefaultMeasures
public ICanBuildCubeDescription<DescriptionT> withDefaultMeasures(String... defaultMeasures)
Description copied from interface:ICanBuildCommonCubeDescriptionChooses the default measures of this cube.- Specified by:
withDefaultMeasuresin interfaceICanBuildCommonCubeDescription<DescriptionT>- Parameters:
defaultMeasures- The default measures.- Returns:
- The builder for chained calls.
- See Also:
IMeasuresDescription.getDefaultMeasures()
-
ensureNoDuplicateName
public static void ensureNoDuplicateName(ImmutableCollection<String> names, String itemErrorPrefix, String parentToString) throws IllegalArgumentException
Ensure that all the names in a given collection are unique within this collection by throwing otherwise.- Parameters:
names- The collection holding the names that should be unique.itemErrorPrefix- The prefix used in front of the failing name in the thrown exception message.parentToString- The description of the parent within which unicity is checked, given in the thrown exception message.- Throws:
IllegalArgumentException- If the unicity constraint is not verified.
-
joinMeasureGroups
public static String joinMeasureGroups(String... values)
Concatenate multiple measure group names in a single string using the standard XMLA separator between them.- Parameters:
values- The groups to concatenate. These strings should not contain any comma.- Returns:
- The groups joined representation.
-
-