public class GlobalProperty extends BaseOpenmrsObject implements CustomValueDescriptor, SingleCustomValue<GlobalProperty>
Constructor and Description |
---|
GlobalProperty()
Default empty constructor
|
GlobalProperty(java.lang.String property)
Constructor defining the key for this GP
|
GlobalProperty(java.lang.String property,
java.lang.String value)
Constructor defining the key and value of this GP
|
GlobalProperty(java.lang.String property,
java.lang.String value,
java.lang.String description)
Constructor defining key/value/description for this GP
|
GlobalProperty(java.lang.String property,
java.lang.String value,
java.lang.String description,
java.lang.Class<? extends CustomDatatype<?>> datatypeClass,
java.lang.String datatypeConfig)
Constructor defining key/value/description/customDatatype/datatypeConfig
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatatypeClassname()
Return the name of a class that implements
CustomDatatype . |
java.lang.String |
getDatatypeConfig()
May be null.
|
java.lang.String |
getDescription() |
GlobalProperty |
getDescriptor()
The metadata describing this custom value
|
java.lang.String |
getHandlerConfig()
May be null.
|
java.lang.Integer |
getId() |
java.lang.String |
getPreferredHandlerClassname()
May be null.
|
java.lang.String |
getProperty() |
java.lang.String |
getPropertyValue() |
java.lang.Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
java.lang.String |
getValueReference() |
boolean |
isDirty() |
void |
setDatatypeClassname(java.lang.String datatypeClassname) |
void |
setDatatypeConfig(java.lang.String datatypeConfig) |
void |
setDescription(java.lang.String description) |
void |
setHandlerConfig(java.lang.String handlerConfig) |
void |
setId(java.lang.Integer id) |
void |
setPreferredHandlerClassname(java.lang.String preferredHandlerClassname) |
void |
setProperty(java.lang.String property) |
void |
setPropertyValue(java.lang.String propertyValue) |
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(java.lang.String valueToPersist)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
java.lang.String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and
the
uuid field surrounded by [ and ] . |
equals, getUuid, hashCode, setUuid
public GlobalProperty()
public GlobalProperty(java.lang.String property)
property
- key to name the propertypublic GlobalProperty(java.lang.String property, java.lang.String value)
property
- key to name the propertyvalue
- value to give to the propertypublic GlobalProperty(java.lang.String property, java.lang.String value, java.lang.String description)
property
- key to name the propertyvalue
- value to give to the propertydescription
- description of how this property is usedpublic GlobalProperty(java.lang.String property, java.lang.String value, java.lang.String description, java.lang.Class<? extends CustomDatatype<?>> datatypeClass, java.lang.String datatypeConfig)
property
- value
- description
- datatypeClass
- datatypeConfig
- public java.lang.String getProperty()
public void setProperty(java.lang.String property)
property
- The property to set.public java.lang.String getPropertyValue()
public void setPropertyValue(java.lang.String propertyValue)
propertyValue
- The propertyValue to set.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- the description to setpublic java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
public java.lang.String getDatatypeClassname()
CustomValueDescriptor
CustomDatatype
.getDatatypeClassname
in interface CustomValueDescriptor
CustomValueDescriptor.getDatatypeClassname()
public void setDatatypeClassname(java.lang.String datatypeClassname)
datatypeClassname
- the datatypeClassname to setpublic java.lang.String getDatatypeConfig()
CustomValueDescriptor
getDatatypeConfig
in interface CustomValueDescriptor
CustomValueDescriptor.getDatatypeConfig()
public void setDatatypeConfig(java.lang.String datatypeConfig)
datatypeConfig
- the datatypeConfig to setpublic java.lang.String getPreferredHandlerClassname()
CustomValueDescriptor
getPreferredHandlerClassname
in interface CustomValueDescriptor
CustomDatatypeHandler
chosen by the
system administrator for this attribute type.CustomValueDescriptor.getPreferredHandlerClassname()
public void setPreferredHandlerClassname(java.lang.String preferredHandlerClassname)
preferredHandlerClassname
- the preferredHandlerClassname to setpublic java.lang.String getHandlerConfig()
CustomValueDescriptor
getHandlerConfig
in interface CustomValueDescriptor
CustomValueDescriptor.getHandlerConfig()
public void setHandlerConfig(java.lang.String handlerConfig)
handlerConfig
- the handlerConfig to setpublic java.lang.String toString()
BaseOpenmrsObject
uuid
field surrounded by [
and ]
. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid
field is null
, it delegates to
Object.toString()
toString
in class BaseOpenmrsObject
Object.toString()
public GlobalProperty getDescriptor()
SingleCustomValue
getDescriptor
in interface SingleCustomValue<GlobalProperty>
SingleCustomValue.getDescriptor()
public java.lang.String getValueReference()
getValueReference
in interface SingleCustomValue<GlobalProperty>
SingleCustomValue.getValueReference()
public void setValueReferenceInternal(java.lang.String valueToPersist) 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<GlobalProperty>
InvalidCustomValueException
SingleCustomValue.setValueReferenceInternal(java.lang.String)
public java.lang.Object getValue() throws InvalidCustomValueException
SingleCustomValue
CustomDatatype.fromReferenceString(String)
.)getValue
in interface SingleCustomValue<GlobalProperty>
InvalidCustomValueException
SingleCustomValue.getValue()
public <T> void setValue(T typedValue) throws InvalidCustomValueException
SingleCustomValue
CustomDatatype#toReferenceString(Object)
setValue
in interface SingleCustomValue<GlobalProperty>
InvalidCustomValueException
SingleCustomValue.setValue(java.lang.Object)
public boolean isDirty()
isDirty
in interface SingleCustomValue<GlobalProperty>
CustomDatatype.save(Object, String)
needs to be calledSingleCustomValue.isDirty()
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.