예제 #1
0
        private void SpecializeFluentModels()
        {
            HashSet <string> seenModels = new HashSet <string>();

            // Promotes the general fluent models to top-level-groupable vs top-level-non-groupable nested child vs other.
            //

            // Specialize the GROUPABLEMODEL
            //
            this.GroupableFluentModels = this.Select(kv => kv.Value)
                                         .SelectMany(fluentMethodGropList => fluentMethodGropList)
                                         .Where(group => group.Type == MethodGroupType.GroupableTopLevel)
                                         .Select(group => new GroupableFluentModelInterface(group.StandardFluentModel))
                                         .Distinct(CreatableUpdatableModel.EqualityComparer <GroupableFluentModelInterface>());

            this.GroupableFluentModels.ForEach(m => seenModels.Add(m.JavaInterfaceName));

            // Specialize the NESTEDFLUENTMODEL
            //
            this.NestedFluentModels = this.Select(kv => kv.Value)
                                      .SelectMany(fluentMethodGropList => fluentMethodGropList)
                                      .Where(group => group.Type == MethodGroupType.Nested)
                                      .Select(group => new NestedFluentModelInterface(group.StandardFluentModel))
                                      .Distinct(CreatableUpdatableModel.EqualityComparer <NestedFluentModelInterface>());

            this.NestedFluentModels.ForEach(m => seenModels.Add(m.JavaInterfaceName));

            // Specialize the TOP-LEVEL NONGROUPABLEMODEL
            //
            this.NonGroupableTopLevelFluentModels = this.Select(kv => kv.Value)
                                                    .SelectMany(fluentMethodGropList => fluentMethodGropList)
                                                    .Where(group => group.Type == MethodGroupType.NonGroupableTopLevel)
                                                    .Select(group => new NonGroupableTopLevelFluentModelInterface(group.StandardFluentModel))
                                                    .Distinct(CreatableUpdatableModel.EqualityComparer <NonGroupableTopLevelFluentModelInterface>());

            NonGroupableTopLevelFluentModels.ForEach(m => seenModels.Add(m.JavaInterfaceName));

            // Specialize wrappable READONLYMODEL
            //
            this.ReadonlyFluentModels = this.Select(kv => kv.Value)
                                        .SelectMany(fluentMethodGropList => fluentMethodGropList)
                                        .SelectMany(group => group.OtherMethods.OtherFluentModels)
                                        .OfType <WrappableFluentModel>()
                                        .Distinct(WrappableFluentModel.EqualityComparer())
                                        .Where(fluentModel => !seenModels.Contains(fluentModel.JavaInterfaceName))
                                        .Select(fluentModel => new ReadOnlyFluentModelInterface(fluentModel, this, this.ManagerName));
        }
예제 #2
0
 public WrapExistingModelFunc(WrappableFluentModel fluentModel)
 {
     this.fluentModel = fluentModel ?? throw new ArgumentNullException(nameof(fluentModel));
 }
예제 #3
0
 public ClientFluentReadOnlyModelInterface(WrappableFluentModel fluentModel, SegmentFluentMethodGroups fluentMethodGroups, string managerTypeName)
 {
     this.fluentModel        = fluentModel;
     this.fluentMethodGroups = fluentMethodGroups;
     this.ManagerTypeName    = managerTypeName;
 }