Skip to content

Commit

Permalink
TRUNK-5699 Deprecate (find/get)PossibleValues
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshRakesh committed Feb 12, 2020
1 parent 0cda1f6 commit 76d9b47
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/src/main/java/org/openmrs/Attributable.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@ public interface Attributable<E> {
* database is delved into and all Location objects should be returned
*
* @return List of objects that can be assigned
* @deprecated Data provided by this method can be better achieved from
* appropriate service at point of use.
*/
@Deprecated
public List<E> getPossibleValues();

/**
* Search for possible values of this object using the given search string
*
* @param searchText String to search on
* @return List of possible objects that can be assigned
* @deprecated Data provided by this method can be better achieved from
* appropriate service at point of use.
*/
@Deprecated
public List<E> findPossibleValues(String searchText);

/**
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/Concept.java
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@ public String toString() {
* @see org.openmrs.Attributable#findPossibleValues(java.lang.String)
*/
@Override
@Deprecated
public List<Concept> findPossibleValues(String searchText) {
List<Concept> concepts = new ArrayList<>();
try {
Expand All @@ -1428,6 +1429,7 @@ public List<Concept> findPossibleValues(String searchText) {
* @see org.openmrs.Attributable#getPossibleValues()
*/
@Override
@Deprecated
public List<Concept> getPossibleValues() {
try {
return Context.getConceptService().getConceptsByName("");
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public void setCountyDistrict(String countyDistrict) {
* @see org.openmrs.Attributable#findPossibleValues(java.lang.String)
*/
@Override
@Deprecated
public List<Location> findPossibleValues(String searchText) {
try {
return Context.getLocationService().getLocations(searchText);
Expand All @@ -285,6 +286,7 @@ public List<Location> findPossibleValues(String searchText) {
* @see org.openmrs.Attributable#getPossibleValues()
*/
@Override
@Deprecated
public List<Location> getPossibleValues() {
try {
return Context.getLocationService().getAllLocations();
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public User removeRole(Role role) {
* @see org.openmrs.Attributable#findPossibleValues(java.lang.String)
*/
@Override
@Deprecated
public List<User> findPossibleValues(String searchText) {
try {
return Context.getUserService().getUsersByName(searchText, "", false);
Expand All @@ -296,6 +297,7 @@ public List<User> findPossibleValues(String searchText) {
* @see org.openmrs.Attributable#getPossibleValues()
*/
@Override
@Deprecated
public List<User> getPossibleValues() {
try {
return Context.getUserService().getAllUsers();
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/util/AttributableDate.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public AttributableDate(long time) {
* @see org.openmrs.Attributable#findPossibleValues(java.lang.String)
*/
@Override
@Deprecated
public List<AttributableDate> findPossibleValues(String searchText) {
// TODO Auto-generated method stub
return null;
Expand All @@ -74,6 +75,7 @@ public String getDisplayString() {
* @see org.openmrs.Attributable#getPossibleValues()
*/
@Override
@Deprecated
public List<AttributableDate> getPossibleValues() {
// TODO Auto-generated method stub
return null;
Expand Down

0 comments on commit 76d9b47

Please sign in to comment.