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 | |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 3 | import android.view.inspector.InspectionCompanion; |
| 4 | import android.view.inspector.PropertyMapper; |
| 5 | import android.view.inspector.PropertyReader; |
| 6 | import java.lang.Override; |
| 7 | |
| 8 | /** |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 9 | * Inspection companion for {@link TestNode}. |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 10 | * |
| 11 | * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator} |
| 12 | * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}. |
| 13 | */ |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 14 | public final class TestNode$$InspectionCompanion implements InspectionCompanion<TestNode> { |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 15 | /** |
| 16 | * Set by {@link #mapProperties(PropertyMapper)} once properties have been mapped. |
| 17 | */ |
| 18 | private boolean mPropertiesMapped = false; |
| 19 | |
| 20 | /** |
| 21 | * Property ID of {@code noAttributeProperty}. |
| 22 | */ |
| 23 | private int mNoAttributePropertyId; |
| 24 | |
| 25 | @Override |
| 26 | public void mapProperties(PropertyMapper propertyMapper) { |
Ashley Rose | c1a4dec | 2018-12-13 18:06:30 -0500 | [diff] [blame] | 27 | mNoAttributePropertyId = propertyMapper.mapInt("noAttributeProperty", 0); |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 28 | mPropertiesMapped = true; |
| 29 | } |
| 30 | |
| 31 | @Override |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 32 | public void readProperties(TestNode node, PropertyReader propertyReader) { |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 33 | if (!mPropertiesMapped) { |
| 34 | throw new InspectionCompanion.UninitializedPropertyMapException(); |
| 35 | } |
Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 36 | propertyReader.readInt(mNoAttributePropertyId, node.getNoAttributeProperty()); |
Ashley Rose | 171a723 | 2018-12-11 17:32:58 -0500 | [diff] [blame] | 37 | } |
| 38 | } |