Merge pull request #1274 from hapifhir/ja_20230523_1262_fix_asstringvalue
Fix asStringValue on IdType
This commit is contained in:
commit
e724c9d58b
|
@ -409,6 +409,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionIdPart() {
|
||||
return myUnqualifiedVersionId;
|
||||
|
|
|
@ -387,6 +387,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionIdPart() {
|
||||
return myUnqualifiedVersionId;
|
||||
|
|
|
@ -384,6 +384,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersionIdPart() {
|
||||
return myUnqualifiedVersionId;
|
||||
|
|
|
@ -495,6 +495,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value
|
||||
* <p>
|
||||
|
|
|
@ -493,6 +493,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value
|
||||
* <p>
|
||||
|
|
|
@ -493,6 +493,11 @@ public final class IdType extends UriType implements IPrimitiveType<String>, IId
|
|||
return getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String asStringValue() {
|
||||
return getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value
|
||||
* <p>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package org.hl7.fhir.r5.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class IdTypeTest {
|
||||
|
||||
@Test
|
||||
public void testAsString() {
|
||||
IdType t = new IdType("Patient/123");
|
||||
assertEquals("Patient/123", t.asStringValue());
|
||||
assertEquals("Patient/123", t.getValueAsString());
|
||||
assertEquals("Patient/123", t.getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAsStringFromComponentParts() {
|
||||
IdType t = new IdType("http://foo", "Patient", "123", "1");
|
||||
assertEquals("http://foo/Patient/123/_history/1", t.asStringValue());
|
||||
assertEquals("http://foo/Patient/123/_history/1", t.getValueAsString());
|
||||
assertEquals("http://foo/Patient/123/_history/1", t.getValue());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue