Class SimpleChartJsDataBuilder<V extends Serializable>
- java.lang.Object
-
- nl.crashdata.chartjs.data.simple.builder.SimpleChartJsDataBuilder<V>
-
- All Implemented Interfaces:
SimpleChartJsBuilder<SimpleChartJsData<V>>
public class SimpleChartJsDataBuilder<V extends Serializable> extends Object implements SimpleChartJsBuilder<SimpleChartJsData<V>>
-
-
Constructor Summary
Constructors Constructor Description SimpleChartJsDataBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleChartJsDatasetBuilder<V>addDataset()SimpleChartJsData<V>build()Builds a validCsuch thatbuilder.build() != builder.build().booleanisValid()Returnstrueif the state of this builder, including all its delegate builders, is ready to build.SimpleChartJsDataBuilder<V>withDatasets(List<SimpleChartJsDatasetBuilder<V>> datasets)SimpleChartJsDataBuilder<V>withLabels(List<String> labels)
-
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from interface:SimpleChartJsBuilderReturnstrueif the state of this builder, including all its delegate builders, is ready to build. "Ready to build" means that this builder, including all its delegate builders, is in such a state thatSimpleChartJsBuilder.build()would return a viable SimpleChartJs configuration object.- Specified by:
isValidin interfaceSimpleChartJsBuilder<V extends Serializable>
-
addDataset
public SimpleChartJsDatasetBuilder<V> addDataset()
-
withDatasets
public SimpleChartJsDataBuilder<V> withDatasets(List<SimpleChartJsDatasetBuilder<V>> datasets)
-
withLabels
public SimpleChartJsDataBuilder<V> withLabels(List<String> labels)
-
build
public SimpleChartJsData<V> build() throws IllegalStateException
Description copied from interface:SimpleChartJsBuilderBuilds a validCsuch thatbuilder.build() != builder.build().- Specified by:
buildin interfaceSimpleChartJsBuilder<V extends Serializable>- Returns:
- a valid
Cif and only ifSimpleChartJsBuilder.isValid()returns true. - Throws:
IllegalStateException- if called whenSimpleChartJsBuilder.isValid()returns false
-
-