| package com.android.node; |
| |
| import android.view.inspector.InspectionCompanion; |
| import android.view.inspector.IntFlagMapping; |
| import android.view.inspector.PropertyMapper; |
| import android.view.inspector.PropertyReader; |
| import java.lang.Override; |
| |
| /** |
| * Inspection companion for {@link TestNode}. |
| * |
| * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator} |
| * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}. |
| */ |
| public final class TestNode$InspectionCompanion implements InspectionCompanion<TestNode> { |
| /** |
| * Guards against reading properties before mapping them. |
| */ |
| private boolean mPropertiesMapped = false; |
| |
| /** |
| * Property ID of {@code intFlag}. |
| */ |
| private int mIntFlagId; |
| |
| @Override |
| public void mapProperties(PropertyMapper propertyMapper) { |
| final IntFlagMapping intFlagFlagMapping = new IntFlagMapping(); |
| intFlagFlagMapping.add(0x00000003, 0x00000002, "OVERDRIVE"); |
| intFlagFlagMapping.add(0x00000003, 0x00000001, "TURBO"); |
| intFlagFlagMapping.add(0x00000004, 0x00000004, "WARP"); |
| mIntFlagId = propertyMapper.mapIntFlag("intFlag", 0, intFlagFlagMapping::get); |
| mPropertiesMapped = true; |
| } |
| |
| @Override |
| public void readProperties(TestNode node, PropertyReader propertyReader) { |
| if (!mPropertiesMapped) { |
| throw new InspectionCompanion.UninitializedPropertyMapException(); |
| } |
| propertyReader.readIntFlag(mIntFlagId, node.getIntFlag()); |
| } |
| } |