mirror of
https://github.com/esiur/esiur-js.git
synced 2026-04-04 05:58:22 +00:00
2.0.0
This commit is contained in:
34
src/Resource/FactoryEntry.js
Normal file
34
src/Resource/FactoryEntry.js
Normal file
@@ -0,0 +1,34 @@
|
||||
export default class FactoryEntry {
|
||||
|
||||
//Type get type => T;
|
||||
|
||||
//late Type nullableType;
|
||||
//final Function instanceCreator;
|
||||
//final Function arrayCreator = () => <T>[];
|
||||
//final RepresentationType representationType;
|
||||
|
||||
isMapKeySubType(map) {
|
||||
//return map is Map<T, dynamic>;
|
||||
}
|
||||
|
||||
isMapValueSubType(map) {
|
||||
//return map is Map<dynamic, T>;
|
||||
}
|
||||
|
||||
isListSubType(list) {
|
||||
//return list is List<T>;
|
||||
}
|
||||
|
||||
constructor(type, representationType) {
|
||||
this.type = type;
|
||||
this.nullableType = this.getNullableType(type);
|
||||
this.representationType = representationType;
|
||||
}
|
||||
|
||||
getNullableType(type){
|
||||
let c = class extends type {};
|
||||
Object.defineProperty(c, "name", {value: "Nullable" + type.name});
|
||||
Object.defineProperty(c, "nullable", {value: true});
|
||||
return c;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user