blob: b491de1d63adbded434d94e6a55bf45fe2649088 [file] [log] [blame]
Ashley Rose0b671da2019-01-25 15:41:29 -05001package com.android.node;
2
3import android.R;
4import android.view.inspector.InspectionCompanion;
5import android.view.inspector.IntEnumMapping;
6import android.view.inspector.PropertyMapper;
7import android.view.inspector.PropertyReader;
8import java.lang.Override;
9
10/**
11 * Inspection companion for {@link TestNode}.
12 *
13 * Generated by {@link android.processor.view.inspector.InspectionCompanionGenerator}
14 * on behalf of {@link android.processor.view.inspector.InspectionCompanionGeneratorTest}.
15 */
Ashley Rosefdb5af22019-03-08 17:23:38 -050016public final class TestNode$InspectionCompanion implements InspectionCompanion<TestNode> {
Ashley Rose0b671da2019-01-25 15:41:29 -050017 /**
18 * Set by {@link #mapProperties(PropertyMapper)} once properties have been mapped.
19 */
20 private boolean mPropertiesMapped = false;
21
22 /**
23 * Property ID of {@code intEnumProperty}.
24 */
25 private int mIntEnumPropertyId;
26
27 @Override
28 public void mapProperties(PropertyMapper propertyMapper) {
29 mIntEnumPropertyId = propertyMapper.mapIntEnum("intEnumProperty", R.attr.intEnumProperty,
30 new IntEnumMapping.Builder()
31 .addValue("ONE", 1)
32 .addValue("TWO", 2)
33 .addValue("THREE", 3)
34 .build());
35 mPropertiesMapped = true;
36 }
37
38 @Override
39 public void readProperties(TestNode node, PropertyReader propertyReader) {
40 if (!mPropertiesMapped) {
41 throw new InspectionCompanion.UninitializedPropertyMapException();
42 }
43 propertyReader.readIntEnum(mIntEnumPropertyId, node.getIntEnumProperty());
44 }
45}