diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumFactory.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumFactory.java index 15d05589691..9e2d198dfd4 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumFactory.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumFactory.java @@ -24,21 +24,26 @@ import java.io.Serializable; public interface IBaseEnumFactory> extends Serializable { - /** - * Read an enumeration value from the string that represents it on the XML or JSON - * - * @param codeString the value found in the XML or JSON - * @return the enumeration value - * @throws IllegalArgumentException is the value is not known - */ - public T fromCode(String codeString) throws IllegalArgumentException; + /** + * Read an enumeration value from the string that represents it on the XML or JSON + * + * @param codeString the value found in the XML or JSON + * @return the enumeration value + * @throws IllegalArgumentException is the value is not known + */ + T fromCode(String codeString) throws IllegalArgumentException; - /** - * Get the XML/JSON representation for an enumerated value - * - * @param code - the enumeration value - * @return the XML/JSON representation - */ - public String toCode(T code); + /** + * Get the XML/JSON representation for an enumerated value + * + * @param code - the enumeration value + * @return the XML/JSON representation + */ + String toCode(T code); + + /** + * Get the system for a given enum value + */ + default String toSystem(T theValue) { return null; } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumeration.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumeration.java index 13f2a63218b..9f8c2125438 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumeration.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseEnumeration.java @@ -23,6 +23,6 @@ package org.hl7.fhir.instance.model.api; public interface IBaseEnumeration> extends IPrimitiveType { - // Marker interface - + default IBaseEnumFactory getEnumFactory() { return null; } + }