mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
Remove deprecated getMetadata(Context, String) from CommunityService, CollectionService.
This commit is contained in:
@@ -410,6 +410,24 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve first metadata field value
|
||||
*
|
||||
* @param dso The DSpaceObject which we ask for metadata.
|
||||
* @param field {schema, element, qualifier} for the desired field.
|
||||
* @param language the language to match, or <code>Item.ANY</code>
|
||||
* @return the first metadata field value
|
||||
*/
|
||||
@Override
|
||||
public String getMetadataFirstValue(T dso, MetadataFieldName field, String language) {
|
||||
List<MetadataValue> metadataValues
|
||||
= getMetadata(dso, field.SCHEMA, field.ELEMENT, field.QUALIFIER, language);
|
||||
if (CollectionUtils.isNotEmpty(metadataValues)) {
|
||||
return metadataValues.get(0).getValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set first metadata field value
|
||||
*
|
||||
|
Reference in New Issue
Block a user