package schema import ( ld "gitlab.dms3.io/ld/go-ld-prime" schemadmt "gitlab.dms3.io/ld/go-ld-prime/schema/dmt" ) type TypeList struct { name TypeName dmt schemadmt.TypeList ts *TypeSystem } // -- schema.Type interface satisfaction --> var _ Type = (*TypeList)(nil) func (t *TypeList) _Type() {} func (t *TypeList) TypeSystem() *TypeSystem { return t.ts } func (TypeList) TypeKind() TypeKind { return TypeKind_Map } func (t *TypeList) Name() TypeName { return t.name } func (t TypeList) RepresentationBehavior() ld.Kind { return ld.Kind_Map } // -- specific to TypeList --> // ValueType returns the Type of the map values. func (t *TypeList) ValueType() Type { return t.ts.types[t.dmt.FieldValueType().TypeReference()] } // ValueIsNullable returns a bool describing if the map values are permitted // to be null. func (t *TypeList) ValueIsNullable() bool { return t.dmt.FieldValueNullable().Bool() }