public class GlobalProperty extends BaseOpenmrsObject implements CustomValueDescriptor, SingleCustomValue<GlobalProperty>
| Constructor and Description |
|---|
GlobalProperty()
Default empty constructor
|
GlobalProperty(String property)
Constructor defining the key for this GP
|
GlobalProperty(String property,
String value)
Constructor defining the key and value of this GP
|
GlobalProperty(String property,
String value,
String description)
Constructor defining key/value/description for this GP
|
GlobalProperty(String property,
String value,
String description,
Class<? extends CustomDatatype<?>> datatypeClass,
String datatypeConfig)
Constructor defining key/value/description/customDatatype/datatypeConfig
|
| Modifier and Type | Method and Description |
|---|---|
User |
getChangedBy() |
String |
getDatatypeClassname()
Return the name of a class that implements
CustomDatatype. |
String |
getDatatypeConfig()
May be null.
|
Date |
getDateChanged() |
Privilege |
getDeletePrivilege()
Get privilege which can delete this globalProperty
|
String |
getDescription() |
GlobalProperty |
getDescriptor() |
boolean |
getDirty() |
Privilege |
getEditPrivilege()
Gets privilege which can edit this globalProperty
|
String |
getHandlerConfig()
May be null.
|
Integer |
getId() |
String |
getPreferredHandlerClassname()
May be null.
|
String |
getProperty() |
String |
getPropertyValue() |
Object |
getValue()
Convenience method to get the typed version of the serializedValue.
|
String |
getValueReference() |
Privilege |
getViewPrivilege()
Gets privilege which can view this globalProperty
|
boolean |
isDirty()
Deprecated.
as of 2.0, use
getDirty() |
void |
setChangedBy(User changedBy) |
void |
setDatatypeClassname(String datatypeClassname) |
void |
setDatatypeConfig(String datatypeConfig) |
void |
setDateChanged(Date dateChanged) |
void |
setDeletePrivilege(Privilege deletePrivilege)
Sets privilege which can delete this globalProperty
|
void |
setDescription(String description) |
void |
setEditPrivilege(Privilege editPrivilege)
Sets privilege which can edit this globalProperty
|
void |
setHandlerConfig(String handlerConfig) |
void |
setId(Integer id) |
void |
setPreferredHandlerClassname(String preferredHandlerClassname) |
void |
setProperty(String property) |
void |
setPropertyValue(String propertyValue) |
<T> void |
setValue(T typedValue)
Sets the typed value.
|
void |
setValueReferenceInternal(String valueToPersist)
Directly set the String value that OpenMRS should persist in the database
in a varchar column.
|
void |
setViewPrivilege(Privilege viewPrivilege)
Sets privilege which can view this globalProperty
|
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
equals, getUuid, hashCode, setUuidpublic GlobalProperty()
public GlobalProperty(String property)
property - key to name the propertypublic GlobalProperty(String property, String value)
property - key to name the propertyvalue - value to give to the propertypublic GlobalProperty(String property, String value, String description)
property - key to name the propertyvalue - value to give to the propertydescription - description of how this property is usedpublic GlobalProperty(String property, String value, String description, Class<? extends CustomDatatype<?>> datatypeClass, String datatypeConfig)
property - value - description - datatypeClass - datatypeConfig - public String getProperty()
public void setProperty(String property)
property - The property to set.public String getPropertyValue()
public void setPropertyValue(String propertyValue)
propertyValue - The propertyValue to set.public String getDescription()
public void setDescription(String description)
description - the description to setpublic Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)public String getDatatypeClassname()
CustomValueDescriptorCustomDatatype.getDatatypeClassname in interface CustomValueDescriptorCustomValueDescriptor.getDatatypeClassname()public void setDatatypeClassname(String datatypeClassname)
datatypeClassname - the datatypeClassname to setpublic String getDatatypeConfig()
CustomValueDescriptorgetDatatypeConfig in interface CustomValueDescriptorCustomValueDescriptor.getDatatypeConfig()public void setDatatypeConfig(String datatypeConfig)
datatypeConfig - the datatypeConfig to setpublic String getPreferredHandlerClassname()
CustomValueDescriptorgetPreferredHandlerClassname in interface CustomValueDescriptorCustomDatatypeHandler chosen by the
system administrator for this attribute type.CustomValueDescriptor.getPreferredHandlerClassname()public void setPreferredHandlerClassname(String preferredHandlerClassname)
preferredHandlerClassname - the preferredHandlerClassname to setpublic String getHandlerConfig()
CustomValueDescriptorgetHandlerConfig in interface CustomValueDescriptorCustomValueDescriptor.getHandlerConfig()public void setHandlerConfig(String handlerConfig)
handlerConfig - the handlerConfig to setpublic String toString()
BaseOpenmrsObjectClassName{hashCode=..., uuid=...}
If the uuid field is null, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString in class BaseOpenmrsObjectObject.toString()public GlobalProperty getDescriptor()
getDescriptor in interface SingleCustomValue<GlobalProperty>SingleCustomValue.getDescriptor()public String getValueReference()
getValueReference in interface SingleCustomValue<GlobalProperty>SingleCustomValue.getValueReference()public void setValueReferenceInternal(String valueToPersist)
SingleCustomValueInvalidCustomValueException 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>SingleCustomValue.setValueReferenceInternal(java.lang.String)public Object getValue()
SingleCustomValueCustomDatatype.fromReferenceString(String).)getValue in interface SingleCustomValue<GlobalProperty>SingleCustomValue.getValue()public <T> void setValue(T typedValue)
SingleCustomValueCustomDatatype.getReferenceStringForValue(Object)setValue in interface SingleCustomValue<GlobalProperty>SingleCustomValue.setValue(java.lang.Object)@Deprecated public boolean isDirty()
getDirty()isDirty in interface SingleCustomValue<GlobalProperty>CustomDatatype.save(Object, String) needs to be calledSingleCustomValue.isDirty()public boolean getDirty()
public User getChangedBy()
public void setChangedBy(User changedBy)
changedBy - The user that changed this objectpublic Date getDateChanged()
public void setDateChanged(Date dateChanged)
dateChanged - The date this object was changedpublic Privilege getViewPrivilege()
public void setViewPrivilege(Privilege viewPrivilege)
viewPrivilege - the viewPrivilege to setpublic Privilege getEditPrivilege()
public void setEditPrivilege(Privilege editPrivilege)
editPrivilege - the editPrivilege to setpublic Privilege getDeletePrivilege()
public void setDeletePrivilege(Privilege deletePrivilege)
deletePrivilege - the deletePrivilege to setCopyright © 2024 OpenMRS Inc.. All rights reserved.