Пример #1
0
        public abstract void WriteTo(Stream stream); //Throws IOException

        public static TelepathySchema WithoutKeys(TelepathySchema schema)
        {
            switch (schema.SchemaType.TypeId)
            {
            case SchemaType.SetSchemaTypeId:
                var setSchema = schema as TelepathySetSchema;
                if (setSchema?.HashKey != null)
                {
                    setSchema = TelepathySetSchema(setSchema.Name, setSchema.ElementType);
                }
                return(setSchema);

            case SchemaType.MapSchemaTypeId:
                var mapSchema = schema as TelepathyMapSchema;
                if (mapSchema?.HashKey != null)
                {
                    mapSchema = new TelepathyMapSchema(mapSchema.Name, mapSchema.KeyType, mapSchema.ValueType);
                }
                return(mapSchema);

            default:
                return(schema);
            }
        }
Пример #2
0
 protected bool Equals(TelepathyMapSchema other)
 {
     return(string.Equals(KeyType, other.KeyType) && string.Equals(ValueType, other.ValueType) &&
            HashKey.Equals(other.HashKey) && KeyTypeState.Equals(other.KeyTypeState) &&
            ValueTypeState.Equals(other.ValueTypeState));
 }