AT
- OwningType
- @MappedSuperclass public abstract class BaseAttribute<AT extends AttributeType,OwningType extends Customizable<?>> extends BaseChangeableOpenmrsData implements Attribute<AT,OwningType>, 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() |
OwningType |
getOwner() |
Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
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(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, getDateChanged, setChangedBy, setDateChanged
getCreator, getDateCreated, setCreator, setDateCreated
getId, getUuid, setId, setUuid
getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setDateVoided, setVoided, setVoidedBy, setVoidReason
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()
getDescriptor
in interface SingleCustomValue<AT extends AttributeType>
SingleCustomValue.getDescriptor()
public String getValueReference()
getValueReference
in interface SingleCustomValue<AT extends AttributeType>
SingleCustomValue.getValueReference()
public void setValueReferenceInternal(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 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.getReferenceStringForValue(Object)
setValue
in interface SingleCustomValue<AT extends AttributeType>
InvalidCustomValueException
SingleCustomValue.setValue(java.lang.Object)
public boolean isDirty()
isDirty
in interface SingleCustomValue<AT extends AttributeType>
public int compareTo(Attribute other)
compareTo
in interface Comparable<Attribute>
Note: this comparator imposes orderings that are inconsistent with equals.
Copyright © 2024 OpenMRS Inc.. All rights reserved.