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 ofGraphicElements
wrapped inOptional
or an emptyOptional
.Returns a set ofLineGraphicInput
instances.getLineGraphicInput
(Set<LineInput> lines) Returns a set ofLineGraphicInput
instances.Returns a set ofNodeGraphicInput
instances.getNodeGraphicInput
(Set<NodeInput> nodes) Returns a set ofNodeGraphicInput
instances.
-
Method Details
-
getGraphicElements
Optional<GraphicElements> getGraphicElements()Should return either a consistent instance ofGraphicElements
wrapped inOptional
or an emptyOptional
. The decision to useOptional
instead of returning theGraphicElements
instance directly is motivated by the fact, that aGraphicElements
is a container instance that depends on several other entities. Without being complete, it is useless for further processing. Hence, whenever at least one entityGraphicElements
depends 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
GraphicElements
instance, 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
GraphicElements
optional orOptional.empty()
-
getNodeGraphicInput
Set<NodeGraphicInput> getNodeGraphicInput()Returns a set ofNodeGraphicInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedNodeGraphicInput
which has to be checked manually, asNodeGraphicInput.equals(Object)
is NOT restricted on the uuid ofNodeGraphicInput
.- Returns:
- a set of object and uuid unique
NodeGraphicInput
entities
-
getNodeGraphicInput
Returns a set ofNodeGraphicInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedNodeGraphicInput
which 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 ofNodeInput
entities, theNodeGraphicInput
instances 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
NodeGraphicInput
entities
-
getLineGraphicInput
Set<LineGraphicInput> getLineGraphicInput()Returns a set ofLineGraphicInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedLineGraphicInput
which has to be checked manually, asLineGraphicInput.equals(Object)
is NOT restricted on the uuid ofLineGraphicInput
.- Returns:
- a set of object and uuid unique
LineGraphicInput
entities
-
getLineGraphicInput
Returns a set ofLineGraphicInput
instances. This set has to be unique in the sense of object uniqueness but also in the sense ofUUID
uniqueness of the providedLineGraphicInput
which 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 ofLineInput
entities, theLineGraphicInput
instances 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
LineGraphicInput
entities
-