org.thewonderlemming.c4plantuml.graphml.model

## Class EdgeModel

- java.lang.Object
- - org.thewonderlemming.c4plantuml.graphml.model.EdgeModel

-     public class EdgeModel
      extends Object

  The <edge> part of the representation of a GraphML stream.

  It is based on JAXB.

  Author:
    thewonderlemming

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TAG_NAME` The current model XML tag name.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOrReplaceData(DataModel data)` Adds the given `DataModel` to the list if its `DataModel.getKey()` is not already there or replaces it else.
    `static WithId<String,WithSource<String,WithTarget<String,WithData<Build<EdgeModel>>>>>` | `builder()` A builder to the current `EdgeModel` class.
    `static WithSource<String,WithTarget<String,WithLabel<WithProtocol<WithC4Level<String>>>>>` | `generateIdFrom(String graphId)` Generates a hopefully unique and repeatably consistent ID for a given graph edge, based on its properties.
    `Optional<String>` | `getC4Level()` Returns the `C4Keys.C4_LEVEL` property.
    `List<DataModel>` | `getData()` Returns the edge's list of `DataModel`.
    `String` | `getId()` Returns the edge's ID.
    `Optional<String>` | `getLabel()` Returns the `C4Keys.LABEL` property.
    `Optional<String>` | `getProtocol()` Returns the `C4Keys.PROTOCOL` property.
    `String` | `getSource()` Returns the edge's source.
    `String` | `getTarget()` Returns the edge's target.
    `void` | `setC4Level(SourceType c4Level)` Sets a <data> tag of type `C4Keys.C4_LEVEL` and with the given value.
    `void` | `setLabel(String label)` Sets a <data> tag of type `C4Keys.LABEL` and with the given value.
    `void` | `setProtocol(String protocol)` Sets a <data> tag of type `C4Keys.PROTOCOL` and with the given value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TAG_NAME

          public static final String TAG_NAME

      The current model XML tag name.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### builder

          public static WithId<String,WithSource<String,WithTarget<String,WithData<Build<EdgeModel>>>>> builder()

      A builder to the current `EdgeModel` class.
      Returns:
        a new `EdgeModel` instance.

    - #### generateIdFrom

          public static WithSource<String,WithTarget<String,WithLabel<WithProtocol<WithC4Level<String>>>>> generateIdFrom(String graphId)

      Generates a hopefully unique and repeatably consistent ID for a given graph edge, based on its properties.
      Parameters:
        `graphId` - the ID of the graph holding the current edge.
      Returns:
        the generated ID.

    - #### addOrReplaceData

          public void addOrReplaceData(DataModel data)

      Adds the given `DataModel` to the list if its `DataModel.getKey()` is not already there or replaces it else.
      Parameters:
        `data` - the given `DataModel` to add/replace.

    - #### getC4Level

          public Optional<String> getC4Level()

      Returns the `C4Keys.C4_LEVEL` property.
      Returns:
        the `C4Keys.C4_LEVEL`.

    - #### getData

          public List<DataModel> getData()

      Returns the edge's list of `DataModel`.
      Returns:
        the list of `DataModel`.

    - #### getId

          public String getId()

      Returns the edge's ID.
      Returns:
        the current ID.

    - #### getLabel

          public Optional<String> getLabel()

      Returns the `C4Keys.LABEL` property.
      Returns:
        the `C4Keys.LABEL`.

    - #### getProtocol

          public Optional<String> getProtocol()

      Returns the `C4Keys.PROTOCOL` property.
      Returns:
        the `C4Keys.PROTOCOL`.

    - #### getSource

          public String getSource()

      Returns the edge's source.
      Returns:
        the current source.

    - #### getTarget

          public String getTarget()

      Returns the edge's target.
      Returns:
        the current target.

    - #### setC4Level

          public void setC4Level(SourceType c4Level)

      Sets a <data> tag of type `C4Keys.C4_LEVEL` and with the given value.
      Parameters:
        `c4Level` - the data value to set.

    - #### setLabel

          public void setLabel(String label)

      Sets a <data> tag of type `C4Keys.LABEL` and with the given value.
      Parameters:
        `label` - the data value to set.

    - #### setProtocol

          public void setProtocol(String protocol)

      Sets a <data> tag of type `C4Keys.PROTOCOL` and with the given value.
      Parameters:
        `protocol` - the data value to set.

Copyright © 2020. All rights reserved.