Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Fixes for SpecialPeople
Browse files Browse the repository at this point in the history
  • Loading branch information
Waguramu committed Jul 26, 2018
1 parent 057a7ca commit cf04bd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dialog/src/main/java/roboy/memory/nodes/Interlocutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.logging.log4j.Logger;
import roboy.memory.*;
import roboy.util.Uuid;
import roboy.util.UuidType;
import roboy.util.UzupisIntents;

import java.io.IOException;
Expand Down Expand Up @@ -46,7 +47,7 @@ public Interlocutor(Neo4jMemoryInterface memory, Uuid uuid) {
public void addName(String name) {
setProperty(Neo4jProperty.name, name);
setLabel(Neo4jLabel.Person);
FAMILIAR = this.init(this)
FAMILIAR = this.init(this);
}

public void addUuid(Uuid uuid) {
Expand Down Expand Up @@ -88,6 +89,7 @@ private MemoryNodeModel queryForMatchingNodes(Interlocutor interlocutor) {
e.printStackTrace();
}
}
return null;
}

private MemoryNodeModel create(Interlocutor interlocutor) {
Expand All @@ -101,6 +103,7 @@ private MemoryNodeModel create(Interlocutor interlocutor) {
e.printStackTrace();
}
}
return null;
}

private void set(MemoryNodeModel node) {
Expand All @@ -113,6 +116,10 @@ public String getName() {
return (String) getProperty(Neo4jProperty.name);
}

public Uuid getUuid(UuidType type) {
return new Uuid(type, (String) getProperty(type.toNeo4jProperty()));
}

public boolean hasRelationship(Neo4jRelationship relationship) {
return !(getRelationship(relationship) == null) && (!getRelationship(relationship).isEmpty());
}
Expand Down
1 change: 1 addition & 0 deletions dialog/src/main/java/roboy/util/Uuid.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class Uuid {

public Uuid(UuidType type, String id) throws IllegalArgumentException {
if (type.isValidUuid(id)) {
this.type = type;
this.uuid = id;
} else {
throw new IllegalArgumentException("The provided UUID for type " + type + " is invalid!");
Expand Down

0 comments on commit cf04bd0

Please sign in to comment.