Immutable class with a primitive property.
        internal static void Dump(AssistantDumper assistant, ImmutableOnePrimitive value, bool withSeparator = false)
        {
            assistant.IncrementDepth();
            if (assistant.MaximumDepthExceeded())
                return;

            assistant.AddStartObject();
            assistant.AddType("Dogen.TestModels.CSharpModel.ImmutableOnePrimitive", true/*withSeparator*/);
            if (value == null)
            {
                assistant.Add("data", "<null>");
                assistant.AddEndObject();
                return;
            }

            assistant.AddKey("data");
            assistant.AddPairSeparator();
            assistant.AddStartObject();
            assistant.Add("Prop0", value.Prop0);
            assistant.AddEndObject(); // data
            assistant.AddEndObject(); // main object
            assistant.HandleMemberSeparator(withSeparator);

            assistant.DecrementDepth();
        }
Example #2
0
        static internal ImmutableOnePrimitive Create(uint position)
        {
            var result = new ImmutableOnePrimitive();

            Populate(result, position);
            return(result);
        }
Example #3
0
        public static string Dump(ImmutableOnePrimitive value)
        {
            var assistant = new AssistantDumper();

            Dump(assistant, value);
            return(assistant.ToString());
        }
Example #4
0
        static internal void Dump(AssistantDumper assistant, ImmutableOnePrimitive value, bool withSeparator = false)
        {
            assistant.IncrementDepth();
            if (assistant.MaximumDepthExceeded())
            {
                return;
            }

            assistant.AddStartObject();
            assistant.AddType("Dogen.TestModels.CSharpModel.ImmutableOnePrimitive", true /*withSeparator*/);
            if (value == null)
            {
                assistant.Add("data", "<null>");
                assistant.AddEndObject();
                return;
            }

            assistant.AddKey("data");
            assistant.AddPairSeparator();
            assistant.AddStartObject();
            assistant.Add("Prop0", value.Prop0);
            assistant.AddEndObject(); // data
            assistant.AddEndObject(); // main object
            assistant.HandleMemberSeparator(withSeparator);

            assistant.DecrementDepth();
        }
 public static string Dump(ImmutableOnePrimitive value)
 {
     var assistant = new AssistantDumper();
     Dump(assistant, value);
     return assistant.ToString();
 }
Example #6
0
 static internal void Populate(ImmutableOnePrimitive value, uint position)
 {
     value.Prop0 = AssistantSequenceGenerator.CreateBool(position + 0);
 }