Skip to content

Commit

Permalink
Merge pull request #27 from protegeproject/update-perspective-id
Browse files Browse the repository at this point in the history
Add value method to PerspectiveId for uniformity with other value obj…
  • Loading branch information
matthewhorridge authored Jan 29, 2025
2 parents 46639ab + 150b496 commit 086fd7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-backend-api</artifactId>
<version>2.1.1</version>
<version>2.1.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<guava.version>28.0</guava.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.stanford.protege.webprotege.perspective;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.auto.value.AutoValue;
import edu.stanford.protege.webprotege.common.UUIDUtil;
Expand Down Expand Up @@ -37,4 +38,9 @@ public static PerspectiveId generate() {
@JsonValue
@Nonnull
public abstract String getId();

@JsonIgnore
public String value() {
return getId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ public void shouldImplementToString() {
assertThat(perspectiveId.toString(), startsWith("PerspectiveId"));
}

@Test
public void shouldHaveValueEqualToId() {
assertThat(perspectiveId.value(), equalTo(perspectiveId.getId()));
}
}

0 comments on commit 086fd7c

Please sign in to comment.