Beispiel #1
0
 public static BifoqlType Optional(BifoqlType type)
 {
     // Already optional? Just return it.
     return((type is OptionalType)
         ? type
         : new OptionalType(type));
 }
Beispiel #2
0
 public BifoqlNamedType(string name, BifoqlType type, string documentation = null)
 {
     Guard.ArgumentNotNull(name, nameof(name));
     Guard.ArgumentNotNull(type, nameof(type));
     Name           = name;
     Type           = type;
     _documentation = documentation;
 }
Beispiel #3
0
        public Schema(BifoqlType rootType, params BifoqlNamedType[] namedTypes)
        {
            _rootType = rootType;

            foreach (var namedType in namedTypes)
            {
                _namedTypes.Add(namedType.Name, namedType);
            }
        }
Beispiel #4
0
        public IndexParameter(string name, BifoqlType type, bool optional)
        {
            Guard.ArgumentNotNull(name, nameof(name));
            Guard.ArgumentNotNull(type, nameof(type));

            Name     = name;
            Type     = type;
            Optional = optional;
        }
Beispiel #5
0
        public MapProperty(string name, BifoqlType type, string documentation)
        {
            Guard.ArgumentNotNull(name, nameof(name));
            Guard.ArgumentNotNull(type, nameof(type));

            Name          = name;
            Type          = type;
            Documentation = documentation;
        }
Beispiel #6
0
 public IndexedType(BifoqlType resultType, params IndexParameter[] parameters)
 {
     Guard.ArgumentNotNull(resultType, nameof(resultType));
     ResultType = resultType;
     Parameters = parameters;
 }
Beispiel #7
0
 public DictionaryType(BifoqlType valueType)
 {
     Guard.ArgumentNotNull(valueType, nameof(valueType));
     ValueType = valueType;
 }
Beispiel #8
0
 public ArrayType(BifoqlType elementType)
 {
     Guard.ArgumentNotNull(elementType, nameof(elementType));
     ElementType = elementType;
 }
Beispiel #9
0
 public OptionalType(BifoqlType type)
 {
     Guard.ArgumentNotNull(type, nameof(type));
     Type = type;
 }
Beispiel #10
0
 public static IndexParameter IndexParameter(string name, BifoqlType type, bool optional = false)
 {
     return(new IndexParameter(name, type, optional));
 }
Beispiel #11
0
 public static BifoqlNamedType CreateNamedType(string name, BifoqlType type, string documentation = null)
 {
     return(new BifoqlNamedType(name, type, documentation));
 }
Beispiel #12
0
 public static BifoqlType Index(BifoqlType resultType, params IndexParameter[] parameters)
 {
     return(new IndexedType(resultType, parameters));
 }
Beispiel #13
0
 public static MapProperty Property(string key, BifoqlType value, string documentation = null)
 {
     return(new MapProperty(key, value, documentation));
 }
Beispiel #14
0
 public static BifoqlType DictionaryOf(BifoqlType valueType)
 {
     return(new DictionaryType(valueType));
 }
Beispiel #15
0
 public static BifoqlType ArrayOf(BifoqlType elementType)
 {
     return(new ArrayType(elementType));
 }