AT
- OwningType
- public abstract class BaseAttribute<AT extends AttributeType,OwningType extends Customizable<?>> extends BaseOpenmrsData implements Attribute<AT,OwningType>, java.lang.Comparable<Attribute>
Attribute
. Actual implementations should be able to extend this
class, and have very little of their own code.creator
Constructor and Description |
---|
BaseAttribute() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Attribute other) |
AT |
getAttributeType() |
AT |
getDescriptor()
The metadata describing this custom value
|
OwningType |
getOwner() |
java.lang.Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
java.lang.String |
getValueReference() |
boolean |
isDirty() |
void |
setAttributeType(AT attributeType) |
void |
setOwner(OwningType owner)
Sets the owner of this attribute
|
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(java.lang.String valueReference)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
equals, getUuid, hashCode, setUuid, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChangedBy, getCreator, getDateChanged, getDateCreated, setChangedBy, setCreator, setDateChanged, setDateCreated
getDateVoided, getVoidedBy, getVoidReason, isVoided, setDateVoided, setVoided, setVoidedBy, setVoidReason
getId, getUuid, setId, setUuid
public OwningType getOwner()
getOwner
in interface Attribute<AT extends AttributeType,OwningType extends Customizable<?>>
Attribute.getOwner()
public void setOwner(OwningType owner)
Attribute
setOwner
in interface Attribute<AT extends AttributeType,OwningType extends Customizable<?>>
Attribute.setOwner(org.openmrs.customdatatype.Customizable)
public void setAttributeType(AT attributeType)
attributeType
- the attributeType to setpublic AT getAttributeType()
getAttributeType
in interface Attribute<AT extends AttributeType,OwningType extends Customizable<?>>
Attribute.getAttributeType()
public AT getDescriptor()
SingleCustomValue
getDescriptor
in interface SingleCustomValue<AT extends AttributeType>
SingleCustomValue.getDescriptor()
public java.lang.String getValueReference()
getValueReference
in interface SingleCustomValue<AT extends AttributeType>
SingleCustomValue.getValueReference()
public void setValueReferenceInternal(java.lang.String valueReference) throws InvalidCustomValueException
SingleCustomValue
InvalidCustomValueException
if it's invalid, rather than setting it blindly.
If you are coding against the OpenMRS API, you should use SingleCustomValue.setValue(Object)
instead.setValueReferenceInternal
in interface SingleCustomValue<AT extends AttributeType>
InvalidCustomValueException
SingleCustomValue.setValueReferenceInternal(java.lang.String)
public java.lang.Object getValue() throws InvalidCustomValueException
SingleCustomValue
CustomDatatype.fromReferenceString(String)
.)getValue
in interface SingleCustomValue<AT extends AttributeType>
InvalidCustomValueException
SingleCustomValue.getValue()
public <T> void setValue(T typedValue) throws InvalidCustomValueException
SingleCustomValue
CustomDatatype#toReferenceString(Object)
setValue
in interface SingleCustomValue<AT extends AttributeType>
InvalidCustomValueException
SingleCustomValue.setValue(java.lang.Object)
public boolean isDirty()
isDirty
in interface SingleCustomValue<AT extends AttributeType>
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.