blob: 08ea6967908667a6f6a1441b8eb0ef2054912319 [file] [log] [blame]
Ashley Rose0b671da2019-01-25 15:41:29 -05001package com.android.node;
Ashley Rose171a7232018-12-11 17:32:58 -05002
3import android.R;
4import android.view.inspector.InspectionCompanion;
5import android.view.inspector.PropertyMapper;
6import android.view.inspector.PropertyReader;
7import java.lang.Override;
8
9/**
Ashley Rose0b671da2019-01-25 15:41:29 -050010 * Inspection companion for {@link TestNode}.
Ashley Rose171a7232018-12-11 17:32:58 -050011 *
12 * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator}
13 * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}.
14 */
Ashley Rosefdb5af22019-03-08 17:23:38 -050015public final class TestNode$InspectionCompanion implements InspectionCompanion<TestNode> {
Ashley Rose171a7232018-12-11 17:32:58 -050016 /**
17 * Set by {@link #mapProperties(PropertyMapper)} once properties have been mapped.
18 */
19 private boolean mPropertiesMapped = false;
20
21 /**
22 * Property ID of {@code boolean}.
23 */
24 private int mBooleanId;
25
26 /**
27 * Property ID of {@code byte}.
28 */
29 private int mByteId;
30
31 /**
32 * Property ID of {@code char}.
33 */
34 private int mCharId;
35
36 /**
37 * Property ID of {@code color}.
38 */
39 private int mColorId;
40
41 /**
42 * Property ID of {@code double}.
43 */
44 private int mDoubleId;
45
46 /**
47 * Property ID of {@code float}.
48 */
49 private int mFloatId;
50
51 /**
52 * Property ID of {@code gravity}.
53 */
54 private int mGravityId;
55
56 /**
57 * Property ID of {@code int}.
58 */
59 private int mIntId;
60
61 /**
62 * Property ID of {@code long}.
63 */
64 private int mLongId;
65
66 /**
67 * Property ID of {@code object}.
68 */
69 private int mObjectId;
70
71 /**
Ashley Rosee8914812019-03-05 17:12:00 -050072 * Property ID of {@code resourceId}.
73 */
74 private int mResourceIdId;
75
76 /**
Ashley Rose171a7232018-12-11 17:32:58 -050077 * Property ID of {@code short}.
78 */
79 private int mShortId;
80
81 @Override
82 public void mapProperties(PropertyMapper propertyMapper) {
83 mBooleanId = propertyMapper.mapBoolean("boolean", R.attr.boolean);
84 mByteId = propertyMapper.mapByte("byte", R.attr.byte);
85 mCharId = propertyMapper.mapChar("char", R.attr.char);
86 mColorId = propertyMapper.mapColor("color", R.attr.color);
87 mDoubleId = propertyMapper.mapDouble("double", R.attr.double);
88 mFloatId = propertyMapper.mapFloat("float", R.attr.float);
89 mGravityId = propertyMapper.mapGravity("gravity", R.attr.gravity);
90 mIntId = propertyMapper.mapInt("int", R.attr.int);
91 mLongId = propertyMapper.mapLong("long", R.attr.long);
92 mObjectId = propertyMapper.mapObject("object", R.attr.object);
Ashley Rosee8914812019-03-05 17:12:00 -050093 mResourceIdId = propertyMapper.mapResourceId("resourceId", R.attr.resourceId);
Ashley Rose171a7232018-12-11 17:32:58 -050094 mShortId = propertyMapper.mapShort("short", R.attr.short);
95 mPropertiesMapped = true;
96 }
97
98 @Override
Ashley Rose0b671da2019-01-25 15:41:29 -050099 public void readProperties(TestNode node, PropertyReader propertyReader) {
Ashley Rose171a7232018-12-11 17:32:58 -0500100 if (!mPropertiesMapped) {
101 throw new InspectionCompanion.UninitializedPropertyMapException();
102 }
Ashley Rose0b671da2019-01-25 15:41:29 -0500103 propertyReader.readBoolean(mBooleanId, node.getBoolean());
104 propertyReader.readByte(mByteId, node.getByte());
105 propertyReader.readChar(mCharId, node.getChar());
106 propertyReader.readColor(mColorId, node.getColor());
107 propertyReader.readDouble(mDoubleId, node.getDouble());
108 propertyReader.readFloat(mFloatId, node.getFloat());
109 propertyReader.readGravity(mGravityId, node.getGravity());
110 propertyReader.readInt(mIntId, node.getInt());
111 propertyReader.readLong(mLongId, node.getLong());
112 propertyReader.readObject(mObjectId, node.getObject());
Ashley Rosee8914812019-03-05 17:12:00 -0500113 propertyReader.readResourceId(mResourceIdId, node.getResourceId());
Ashley Rose0b671da2019-01-25 15:41:29 -0500114 propertyReader.readShort(mShortId, node.getShort());
Ashley Rose171a7232018-12-11 17:32:58 -0500115 }
116}