Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5a858949d4
|
@ -655,13 +655,18 @@ public class HumanName extends Type implements ICompositeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced
|
* <p>Returns the {@link #getTextElement() text} element value if it is not null.</p>
|
||||||
* string separating each part.
|
|
||||||
* <p>
|
* <p>If the {@link #getTextElement() text} element value is null, returns all the components of the name (prefix,
|
||||||
* If none of the parts are populated, returns the {@link #getTextElement() text} element value instead.
|
* given, family, suffix) as a single string with a single spaced string separating each part. </p>
|
||||||
* </p>
|
*
|
||||||
|
* @return the human name as a single string
|
||||||
*/
|
*/
|
||||||
public String getNameAsSingleString() {
|
public String getNameAsSingleString() {
|
||||||
|
if (hasText()) {
|
||||||
|
return getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
List<StringType> nameParts = new ArrayList<StringType>();
|
List<StringType> nameParts = new ArrayList<StringType>();
|
||||||
nameParts.addAll(getPrefix());
|
nameParts.addAll(getPrefix());
|
||||||
nameParts.addAll(getGiven());
|
nameParts.addAll(getGiven());
|
||||||
|
|
|
@ -25,4 +25,14 @@ public class HumanNameTest {
|
||||||
String actual = humanName.getNameAsSingleString();
|
String actual = humanName.getNameAsSingleString();
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getNameAsSingleStringPreferText() {
|
||||||
|
final String expected = "dummy value";
|
||||||
|
HumanName humanName = new HumanName()
|
||||||
|
.setTextElement(new StringType(expected)).addFamily("wrong value");
|
||||||
|
|
||||||
|
String actual = humanName.getNameAsSingleString();
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -668,13 +668,18 @@ public class HumanName extends Type implements ICompositeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced
|
* <p>Returns the {@link #getTextElement() text} element value if it is not null.</p>
|
||||||
* string separating each part.
|
|
||||||
* <p>
|
* <p>If the {@link #getTextElement() text} element value is null, returns all the components of the name (prefix,
|
||||||
* If none of the parts are populated, returns the {@link #getTextElement() text} element value instead.
|
* given, family, suffix) as a single string with a single spaced string separating each part. </p>
|
||||||
* </p>
|
*
|
||||||
|
* @return the human name as a single string
|
||||||
*/
|
*/
|
||||||
public String getNameAsSingleString() {
|
public String getNameAsSingleString() {
|
||||||
|
if (hasText()) {
|
||||||
|
return getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
List<StringType> nameParts = new ArrayList<StringType>();
|
List<StringType> nameParts = new ArrayList<StringType>();
|
||||||
nameParts.addAll(getPrefix());
|
nameParts.addAll(getPrefix());
|
||||||
nameParts.addAll(getGiven());
|
nameParts.addAll(getGiven());
|
||||||
|
|
|
@ -25,4 +25,14 @@ public class HumanNameTest {
|
||||||
String actual = humanName.getNameAsSingleString();
|
String actual = humanName.getNameAsSingleString();
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getNameAsSingleStringPreferText() {
|
||||||
|
final String expected = "dummy value";
|
||||||
|
HumanName humanName = new HumanName()
|
||||||
|
.setTextElement(new StringType(expected)).setFamily("wrong value");
|
||||||
|
|
||||||
|
String actual = humanName.getNameAsSingleString();
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -668,13 +668,18 @@ public class HumanName extends Type implements ICompositeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced
|
* <p>Returns the {@link #getTextElement() text} element value if it is not null.</p>
|
||||||
* string separating each part.
|
|
||||||
* <p>
|
* <p>If the {@link #getTextElement() text} element value is null, returns all the components of the name (prefix,
|
||||||
* If none of the parts are populated, returns the {@link #getTextElement() text} element value instead.
|
* given, family, suffix) as a single string with a single spaced string separating each part. </p>
|
||||||
* </p>
|
*
|
||||||
|
* @return the human name as a single string
|
||||||
*/
|
*/
|
||||||
public String getNameAsSingleString() {
|
public String getNameAsSingleString() {
|
||||||
|
if (hasText()) {
|
||||||
|
return getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
List<StringType> nameParts = new ArrayList<StringType>();
|
List<StringType> nameParts = new ArrayList<StringType>();
|
||||||
nameParts.addAll(getPrefix());
|
nameParts.addAll(getPrefix());
|
||||||
nameParts.addAll(getGiven());
|
nameParts.addAll(getGiven());
|
||||||
|
|
|
@ -27,4 +27,14 @@ public class HumanNameTest {
|
||||||
String actual = humanName.getNameAsSingleString();
|
String actual = humanName.getNameAsSingleString();
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getNameAsSingleStringPreferText() {
|
||||||
|
final String expected = "dummy value";
|
||||||
|
HumanName humanName = new HumanName()
|
||||||
|
.setTextElement(new StringType(expected)).setFamily("wrong value");
|
||||||
|
|
||||||
|
String actual = humanName.getNameAsSingleString();
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,16 +887,21 @@ public class HumanName extends DataType implements ICompositeType {
|
||||||
*/
|
*/
|
||||||
public String getSuffixAsSingleString() {
|
public String getSuffixAsSingleString() {
|
||||||
return joinStringsSpaceSeparated(getSuffix());
|
return joinStringsSpaceSeparated(getSuffix());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Returns the {@link #getTextElement() text} element value if it is not null.</p>
|
||||||
|
|
||||||
|
* <p>If the {@link #getTextElement() text} element value is null, returns all the components of the name (prefix,
|
||||||
|
* given, family, suffix) as a single string with a single spaced string separating each part. </p>
|
||||||
|
*
|
||||||
|
* @return the human name as a single string
|
||||||
|
*/
|
||||||
|
public String getNameAsSingleString() {
|
||||||
|
if (hasText()) {
|
||||||
|
return getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced
|
|
||||||
* string separating each part.
|
|
||||||
* <p>
|
|
||||||
* If none of the parts are populated, returns the {@link #getTextElement() text} element value instead.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public String getNameAsSingleString() {
|
|
||||||
List<StringType> nameParts = new ArrayList<StringType>();
|
List<StringType> nameParts = new ArrayList<StringType>();
|
||||||
nameParts.addAll(getPrefix());
|
nameParts.addAll(getPrefix());
|
||||||
nameParts.addAll(getGiven());
|
nameParts.addAll(getGiven());
|
||||||
|
|
|
@ -25,4 +25,14 @@ public class HumanNameTest {
|
||||||
String actual = humanName.getNameAsSingleString();
|
String actual = humanName.getNameAsSingleString();
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getNameAsSingleStringPreferText() {
|
||||||
|
final String expected = "dummy value";
|
||||||
|
HumanName humanName = new HumanName()
|
||||||
|
.setTextElement(new StringType(expected)).setFamily("wrong value");
|
||||||
|
|
||||||
|
String actual = humanName.getNameAsSingleString();
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -887,17 +887,22 @@ public class HumanName extends DataType implements ICompositeType {
|
||||||
*/
|
*/
|
||||||
public String getSuffixAsSingleString() {
|
public String getSuffixAsSingleString() {
|
||||||
return joinStringsSpaceSeparated(getSuffix());
|
return joinStringsSpaceSeparated(getSuffix());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced
|
* <p>Returns the {@link #getTextElement() text} element value if it is not null.</p>
|
||||||
* string separating each part.
|
|
||||||
* <p>
|
* <p>If the {@link #getTextElement() text} element value is null, returns all the components of the name (prefix,
|
||||||
* If none of the parts are populated, returns the {@link #getTextElement() text} element value instead.
|
* given, family, suffix) as a single string with a single spaced string separating each part. </p>
|
||||||
* </p>
|
*
|
||||||
*/
|
* @return the human name as a single string
|
||||||
|
*/
|
||||||
public String getNameAsSingleString() {
|
public String getNameAsSingleString() {
|
||||||
List<StringType> nameParts = new ArrayList<StringType>();
|
if (hasText()) {
|
||||||
|
return getText().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<StringType> nameParts = new ArrayList<StringType>();
|
||||||
nameParts.addAll(getPrefix());
|
nameParts.addAll(getPrefix());
|
||||||
nameParts.addAll(getGiven());
|
nameParts.addAll(getGiven());
|
||||||
if (hasFamilyElement()) {
|
if (hasFamilyElement()) {
|
||||||
|
|
|
@ -27,4 +27,14 @@ public class HumanNameTest {
|
||||||
String actual = humanName.getNameAsSingleString();
|
String actual = humanName.getNameAsSingleString();
|
||||||
assertEquals(expected, actual);
|
assertEquals(expected, actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getNameAsSingleStringPreferText() {
|
||||||
|
final String expected = "dummy value";
|
||||||
|
HumanName humanName = new HumanName()
|
||||||
|
.setTextElement(new StringType(expected)).setFamily("wrong value");
|
||||||
|
|
||||||
|
String actual = humanName.getNameAsSingleString();
|
||||||
|
assertEquals(expected, actual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -238,6 +238,12 @@
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>${lombok_version}</version>
|
<version>${lombok_version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>${jackson_version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue