Ashley Rose | 89d6bce | 2019-03-01 19:24:50 -0500 | [diff] [blame] | 1 | package com.android.node; |
| 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 | /** |
| 10 | * Inspection companion for {@link TestNode}. |
| 11 | * |
| 12 | * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator} |
| 13 | * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}. |
| 14 | */ |
Ashley Rose | fdb5af2 | 2019-03-08 17:23:38 -0500 | [diff] [blame] | 15 | public final class TestNode$InspectionCompanion implements InspectionCompanion<TestNode> { |
Ashley Rose | 89d6bce | 2019-03-01 19:24:50 -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 fieldProperty}. |
| 23 | */ |
| 24 | private int mFieldPropertyId; |
| 25 | |
| 26 | @Override |
| 27 | public void mapProperties(PropertyMapper propertyMapper) { |
| 28 | mFieldPropertyId = propertyMapper.mapInt("fieldProperty", R.attr.fieldProperty); |
| 29 | mPropertiesMapped = true; |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public void readProperties(TestNode node, PropertyReader propertyReader) { |
| 34 | if (!mPropertiesMapped) { |
| 35 | throw new InspectionCompanion.UninitializedPropertyMapException(); |
| 36 | } |
| 37 | propertyReader.readInt(mFieldPropertyId, node.fieldProperty); |
| 38 | } |
| 39 | } |