Interface GraphicSource

All Superinterfaces:
DataSource
All Known Implementing Classes:
CsvGraphicSource

public interface GraphicSource extends DataSource
Interface that provides the capability to build entities of type GraphicInput from different data sources e.g. .csv files or databases
Since:
08.04.20
  • Method Details

    • getGraphicElements

      Optional<GraphicElements> getGraphicElements()
      Should return either a consistent instance of GraphicElements wrapped in Optional or an empty Optional. The decision to use Optional instead of returning the GraphicElements instance directly is motivated by the fact, that a GraphicElements is a container instance that depends on several other entities. Without being complete, it is useless for further processing. Hence, whenever at least one entity GraphicElements 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 or Optional.empty()
    • getNodeGraphicInput

      Set<NodeGraphicInput> getNodeGraphicInput()
      Returns a set of NodeGraphicInput instances. This set has to be unique in the sense of object uniqueness but also in the sense of UUID uniqueness of the provided NodeGraphicInput which has to be checked manually, as NodeGraphicInput.equals(Object) is NOT restricted on the uuid of NodeGraphicInput.
      Returns:
      a set of object and uuid unique NodeGraphicInput entities
    • getNodeGraphicInput

      Set<NodeGraphicInput> getNodeGraphicInput(Set<NodeInput> nodes)
      Returns a set of NodeGraphicInput instances. This set has to be unique in the sense of object uniqueness but also in the sense of UUID uniqueness of the provided NodeGraphicInput which has to be checked manually, as NodeGraphicInput.equals(Object) is NOT restricted on the uuid of NodeGraphicInput.

      In contrast to getNodeGraphicInput() this interface provides the ability to pass in an already existing set of NodeInput entities, the NodeGraphicInput 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 of LineGraphicInput instances. This set has to be unique in the sense of object uniqueness but also in the sense of UUID uniqueness of the provided LineGraphicInput which has to be checked manually, as LineGraphicInput.equals(Object) is NOT restricted on the uuid of LineGraphicInput.
      Returns:
      a set of object and uuid unique LineGraphicInput entities
    • getLineGraphicInput

      Set<LineGraphicInput> getLineGraphicInput(Set<LineInput> lines)
      Returns a set of LineGraphicInput instances. This set has to be unique in the sense of object uniqueness but also in the sense of UUID uniqueness of the provided LineGraphicInput which has to be checked manually, as LineGraphicInput.equals(Object) is NOT restricted on the uuid of LineGraphicInput.

      In contrast to getLineGraphicInput() this interface provides the ability to pass in an already existing set of LineInput entities, the LineGraphicInput 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