Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 1 | package com.android.node; |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 2 | |
| 3 | import android.R; |
| 4 | import android.view.inspector.InspectionCompanion; |
| 5 | import android.view.inspector.PropertyMapper; |
| 6 | import android.view.inspector.PropertyReader; |
| 7 | import java.lang.Override; |
| 8 | |
| 9 | /** |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 10 | * Inspection companion for {@link TestNode}. |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 11 | * |
| 12 | * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator} |
| 13 | * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}. |
| 14 | */ |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 15 | public final class TestNode$$InspectionCompanion implements InspectionCompanion<TestNode> { |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 16 | /** |
| 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 | /** |
| 72 | * Property ID of {@code short}. |
| 73 | */ |
| 74 | private int mShortId; |
| 75 | |
| 76 | @Override |
| 77 | public void mapProperties(PropertyMapper propertyMapper) { |
| 78 | mBooleanId = propertyMapper.mapBoolean("boolean", R.attr.boolean); |
| 79 | mByteId = propertyMapper.mapByte("byte", R.attr.byte); |
| 80 | mCharId = propertyMapper.mapChar("char", R.attr.char); |
| 81 | mColorId = propertyMapper.mapColor("color", R.attr.color); |
| 82 | mDoubleId = propertyMapper.mapDouble("double", R.attr.double); |
| 83 | mFloatId = propertyMapper.mapFloat("float", R.attr.float); |
| 84 | mGravityId = propertyMapper.mapGravity("gravity", R.attr.gravity); |
| 85 | mIntId = propertyMapper.mapInt("int", R.attr.int); |
| 86 | mLongId = propertyMapper.mapLong("long", R.attr.long); |
| 87 | mObjectId = propertyMapper.mapObject("object", R.attr.object); |
| 88 | mShortId = propertyMapper.mapShort("short", R.attr.short); |
| 89 | mPropertiesMapped = true; |
| 90 | } |
| 91 | |
| 92 | @Override |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 93 | public void readProperties(TestNode node, PropertyReader propertyReader) { |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 94 | if (!mPropertiesMapped) { |
| 95 | throw new InspectionCompanion.UninitializedPropertyMapException(); |
| 96 | } |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 97 | propertyReader.readBoolean(mBooleanId, node.getBoolean()); |
| 98 | propertyReader.readByte(mByteId, node.getByte()); |
| 99 | propertyReader.readChar(mCharId, node.getChar()); |
| 100 | propertyReader.readColor(mColorId, node.getColor()); |
| 101 | propertyReader.readDouble(mDoubleId, node.getDouble()); |
| 102 | propertyReader.readFloat(mFloatId, node.getFloat()); |
| 103 | propertyReader.readGravity(mGravityId, node.getGravity()); |
| 104 | propertyReader.readInt(mIntId, node.getInt()); |
| 105 | propertyReader.readLong(mLongId, node.getLong()); |
| 106 | propertyReader.readObject(mObjectId, node.getObject()); |
| 107 | propertyReader.readShort(mShortId, node.getShort()); |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 108 | } |
| 109 | } |