mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-17 23:13:04 +00:00
61949: replacing object factories with decorator
This commit is contained in:
25
src/app/core/metadata/metadata-field.model.ts
Normal file
25
src/app/core/metadata/metadata-field.model.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ListableObject } from '../../shared/object-collection/shared/listable-object.model';
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { MetadataSchema } from './metadata-schema.model';
|
||||
|
||||
export class MetadataField implements ListableObject {
|
||||
id: number;
|
||||
|
||||
self: string;
|
||||
|
||||
element: string;
|
||||
|
||||
qualifier: string;
|
||||
|
||||
scopeNote: string;
|
||||
|
||||
schema: MetadataSchema;
|
||||
|
||||
toString(separator: string = '.'): string {
|
||||
let key = this.schema.prefix + separator + this.element;
|
||||
if (isNotEmpty(this.qualifier)) {
|
||||
key += separator + this.qualifier;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user