Interface GraphicSource
- All Superinterfaces:
DataSource
- All Known Implementing Classes:
CsvGraphicSource
GraphicInput from different data sources e.g. .csv files
or databases- Since:
- 08.04.20
-
Method Summary
Modifier and TypeMethodDescriptionShould return either a consistent instance ofGraphicElementswrapped inOptionalor an emptyOptional.Returns a set ofLineGraphicInputinstances.getLineGraphicInput(Set<LineInput> lines) Returns a set ofLineGraphicInputinstances.Returns a set ofNodeGraphicInputinstances.getNodeGraphicInput(Set<NodeInput> nodes) Returns a set ofNodeGraphicInputinstances.
-
Method Details
-
getGraphicElements
Optional<GraphicElements> getGraphicElements()Should return either a consistent instance ofGraphicElementswrapped inOptionalor an emptyOptional. The decision to useOptionalinstead of returning theGraphicElementsinstance directly is motivated by the fact, that aGraphicElementsis a container instance that depends on several other entities. Without being complete, it is useless for further processing. Hence, whenever at least one entityGraphicElementsdepends on cannot be provided,Optional.empty()should be returned and extensive logging should provide enough information to debug the error and fix the persistent data that has been failed to processed.Furthermore, it is expected, that the specific implementation of this method ensures not only the completeness of the resulting
GraphicElementsinstance, but also its validity e.g. in the sense that not duplicate UUIDs exist within all entities contained in the returning instance.- Returns:
- either a valid, complete
GraphicElementsoptional orOptional.empty()
-
getNodeGraphicInput
Set<NodeGraphicInput> getNodeGraphicInput()Returns a set ofNodeGraphicInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedNodeGraphicInputwhich has to be checked manually, asNodeGraphicInput.equals(Object)is NOT restricted on the uuid ofNodeGraphicInput.- Returns:
- a set of object and uuid unique
NodeGraphicInputentities
-
getNodeGraphicInput
Returns a set ofNodeGraphicInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedNodeGraphicInputwhich has to be checked manually, asNodeGraphicInput.equals(Object)is NOT restricted on the uuid ofNodeGraphicInput.In contrast to
getNodeGraphicInput()this interface provides the ability to pass in an already existing set ofNodeInputentities, theNodeGraphicInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
- Parameters:
nodes- a set of object and uuid unique nodes that should be used for the returning instances- Returns:
- a set of object and uuid unique
NodeGraphicInputentities
-
getLineGraphicInput
Set<LineGraphicInput> getLineGraphicInput()Returns a set ofLineGraphicInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedLineGraphicInputwhich has to be checked manually, asLineGraphicInput.equals(Object)is NOT restricted on the uuid ofLineGraphicInput.- Returns:
- a set of object and uuid unique
LineGraphicInputentities
-
getLineGraphicInput
Returns a set ofLineGraphicInputinstances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUIDuniqueness of the providedLineGraphicInputwhich has to be checked manually, asLineGraphicInput.equals(Object)is NOT restricted on the uuid ofLineGraphicInput.In contrast to
getLineGraphicInput()this interface provides the ability to pass in an already existing set ofLineInputentities, theLineGraphicInputinstances depend on. Doing so, already loaded nodes can be recycled to improve performance and prevent unnecessary loading operations.If something fails during the creation process it's up to the concrete implementation of an empty set or a set with all entities that has been able to be build is returned.
- Parameters:
lines- a set of object and uuid unique lines that should be used for the returning instances- Returns:
- a set of object and uuid unique
LineGraphicInputentities
-