Ashley Rose | 0b671da | 2019-01-25 15:41:29 -0500 | [diff] [blame] | 1 | package com.android.node; |
| 2 | |
| 3 | import android.view.inspector.InspectionCompanion; |
| 4 | import android.view.inspector.IntFlagMapping; |
| 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 | */ |
| 15 | public final class TestNode$$InspectionCompanion implements InspectionCompanion<TestNode> { |
| 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 intFlag}. |
| 23 | */ |
| 24 | private int mIntFlagId; |
| 25 | |
| 26 | @Override |
| 27 | public void mapProperties(PropertyMapper propertyMapper) { |
| 28 | mIntFlagId = propertyMapper.mapIntFlag("intFlag", 0, new IntFlagMapping.Builder() |
| 29 | .addFlag("OVERDRIVE", 0x00000002, 0x00000003) |
| 30 | .addFlag("TURBO", 0x00000001, 0x00000003) |
| 31 | .addFlag("WARP", 0x00000004) |
| 32 | .build()); |
| 33 | mPropertiesMapped = true; |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public void readProperties(TestNode node, PropertyReader propertyReader) { |
| 38 | if (!mPropertiesMapped) { |
| 39 | throw new InspectionCompanion.UninitializedPropertyMapException(); |
| 40 | } |
| 41 | propertyReader.readIntFlag(mIntFlagId, node.getIntFlag()); |
| 42 | } |
| 43 | } |