Override enum factory interfaces

This commit is contained in:
James Agnew 2019-10-27 17:51:38 -04:00
parent ffb15682de
commit a82da8de1c
2 changed files with 22 additions and 17 deletions

View File

@ -31,7 +31,7 @@ public interface IBaseEnumFactory<T extends Enum<?>> extends Serializable {
* @return the enumeration value * @return the enumeration value
* @throws IllegalArgumentException is the value is not known * @throws IllegalArgumentException is the value is not known
*/ */
public T fromCode(String codeString) throws IllegalArgumentException; T fromCode(String codeString) throws IllegalArgumentException;
/** /**
* Get the XML/JSON representation for an enumerated value * Get the XML/JSON representation for an enumerated value
@ -39,6 +39,11 @@ public interface IBaseEnumFactory<T extends Enum<?>> extends Serializable {
* @param code - the enumeration value * @param code - the enumeration value
* @return the XML/JSON representation * @return the XML/JSON representation
*/ */
public String toCode(T code); String toCode(T code);
/**
* Get the system for a given enum value
*/
default String toSystem(T theValue) { return null; }
} }

View File

@ -23,6 +23,6 @@ package org.hl7.fhir.instance.model.api;
public interface IBaseEnumeration<T extends Enum<?>> extends IPrimitiveType<T> { public interface IBaseEnumeration<T extends Enum<?>> extends IPrimitiveType<T> {
// Marker interface default IBaseEnumFactory<T> getEnumFactory() { return null; }
} }