Files
dspace-angular/src/app/core/auth/auth-object-factory.ts
2019-01-29 16:03:50 +01:00

25 lines
766 B
TypeScript

import { AuthType } from './auth-type';
import { GenericConstructor } from '../shared/generic-constructor';
import { NormalizedAuthStatus } from './models/normalized-auth-status.model';
import { NormalizedEPerson } from '../eperson/models/normalized-eperson.model';
import { NormalizedObject } from '../cache/models/normalized-object.model';
import { CacheableObject } from '../cache/object-cache.reducer';
export class AuthObjectFactory {
public static getConstructor(type): GenericConstructor<NormalizedObject<CacheableObject>> {
switch (type) {
case AuthType.EPerson: {
return NormalizedEPerson
}
case AuthType.Status: {
return NormalizedAuthStatus
}
default: {
return undefined;
}
}
}
}