public static ICollection <SafeType <APIOperation> > AllAPIOperations() { ICollection <SafeType <APIOperation> > set = new HashSet <SafeType <APIOperation> >(); CollectionUtil.AddAll(set, SPI_TO_API.Values); // add Get because it doesn't have a corresponding SPI. set.Add(SafeType <APIOperation> .Get <GetApiOp>()); set.Add(SafeType <APIOperation> .Get <ValidateApiOp>()); return(CollectionUtil.AsReadOnlySet(set)); }
public static ICollection <SafeType <APIOperation> > GetDefaultSupportedOperations(SafeType <Connector> connector) { ICollection <SafeType <APIOperation> > rv = new HashSet <SafeType <APIOperation> >(); ICollection <Type> interfaces = ReflectionUtil.GetTypeErasure(ReflectionUtil.GetAllInterfaces(connector.RawType)); foreach (SafeType <SPIOperation> spi in AllSPIOperations()) { if (interfaces.Contains(spi.RawType)) { CollectionUtil.AddAll(rv, Spi2Apis(spi)); } } //finally add unconditionally supported ops CollectionUtil.AddAll(rv, GetUnconditionallySupportedOperations()); return(CollectionUtil.AsReadOnlySet(rv)); }