Edge extends Element implements EdgeId { @JsonIgnore(false) @JsonGetter("directed") @Override public boolean isDirected() { return directed; } Edge();  Edge(final String group);  Edge(final String group, final Object source, final Object destination, final boolean directed);  Edge(final String group,
                final Object source,
                final Object destination,
                final boolean directed,
                final MatchedVertex matchedVertex,
                final Properties properties); @JsonCreator  Edge(@JsonProperty("group") final String group,
         @JsonProperty("source") final Object source,
         @JsonProperty("destination") final Object destination,
         @JsonProperty("directed") final Boolean directed,
         @JsonProperty("directedType") final DirectedType directedType,
         @JsonProperty("matchedVertex") final MatchedVertex matchedVertex,
         @JsonProperty("properties") final Properties properties); @Override Object getSource(); @Override Object getDestination(); @JsonIgnore @Override DirectedType getDirectedType(); @JsonIgnore(false) @JsonGetter("directed") @Override boolean isDirected(); @Override MatchedVertex getMatchedVertex(); @Override Object getIdentifier(final IdentifierType identifierType); @Override void setIdentifiers(final Object source, final Object destination, final DirectedType directedType); void setIdentifiers(final Object source, final Object destination, final boolean directed); @Override void setIdentifiers(final Object source, final Object destination, final DirectedType directedType, final MatchedVertex matchedVertex); void setIdentifiers(final Object source, final Object destination, final boolean directed, final MatchedVertex matchedVertex); @Override int hashCode(); @Override boolean equals(final Object obj); boolean equals(final Edge edge); @Override Edge emptyClone(); @Override Edge shallowClone(); @Override String toString();  }
@Test public void shouldDeserialiseFromJsonUsingDirectedTrueField() throws SerialisationException { final String json = "{\"class\": \"uk.gov.gchq.gaffer.data.element.Edge\", \"directed\": true}"; final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(), Edge.class); assertTrue(deserialisedEdge.isDirected()); }
@Test public void shouldDeserialiseFromJsonUsingDirectedFalseField() throws SerialisationException { final String json = "{\"class\": \"uk.gov.gchq.gaffer.data.element.Edge\", \"directed\": false}"; final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(), Edge.class); assertFalse(deserialisedEdge.isDirected()); }
@Test public void shouldDeserialiseFromJsonWhenDirectedTypeIsDirected() throws SerialisationException { final String json = "{\"class\": \"uk.gov.gchq.gaffer.data.element.Edge\", \"directedType\": \"DIRECTED\"}"; final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(), Edge.class); assertTrue(deserialisedEdge.isDirected()); }
@Test public void shouldDeserialiseFromJsonWhenDirectedTypeIsUndirected() throws SerialisationException { final String json = "{\"class\": \"uk.gov.gchq.gaffer.data.element.Edge\", \"directedType\": \"UNDIRECTED\"}"; final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(), Edge.class); assertFalse(deserialisedEdge.isDirected()); }
@Test public void shouldDeserialiseFromJsonWhenDirectedTypeIsEither() throws SerialisationException { final String json = "{\"class\": \"uk.gov.gchq.gaffer.data.element.Edge\", \"directedType\": \"EITHER\"}"; final Edge deserialisedEdge = JSONSerialiser.deserialise(json.getBytes(), Edge.class); assertTrue(deserialisedEdge.isDirected()); }