# Print output for @column tags ?> PropertyMapper - Android SDK | Android Developers

Most visited

Recently visited

PropertyMapper

public interface PropertyMapper

android.view.inspector.PropertyMapper


An interface for mapping the string names of inspectable properties to integer identifiers. This interface is consumed by InspectionCompanion#mapProperties(PropertyMapper). Mapping properties to IDs enables quick comparisons against shadow copies of inspectable objects without performing a large number of string comparisons.

See also:

Summary

Nested classes

class PropertyMapper.PropertyConflictException

Thrown from a map method if a property name is already mapped as different type. 

Public methods

abstract int mapBoolean(String name, int attributeId)

Map a string name to an integer ID for a primitive boolean property.

abstract int mapByte(String name, int attributeId)

Map a string name to an integer ID for a primitive byte property.

abstract int mapChar(String name, int attributeId)

Map a string name to an integer ID for a primitive char property.

abstract int mapColor(String name, int attributeId)

Map a string name to an integer ID for a color property.

abstract int mapDouble(String name, int attributeId)

Map a string name to an integer ID for a primitive double property.

abstract int mapFloat(String name, int attributeId)

Map a string name to an integer ID for a primitive float property.

abstract int mapGravity(String name, int attributeId)

Map a string name to an integer ID for a gravity property.

abstract int mapInt(String name, int attributeId)

Map a string name to an integer ID for a primitive int property.

abstract int mapIntEnum(String name, int attributeId, IntFunction<String> mapping)

Map a string name to an integer ID for an enumeration packed into an int property.

abstract int mapIntFlag(String name, int attributeId, IntFunction<Set<String>> mapping)

Map a string name to an integer ID for a flag set packed into an int property.

abstract int mapLong(String name, int attributeId)

Map a string name to an integer ID for a primitive long property.

abstract int mapObject(String name, int attributeId)

Map a string name to an integer ID for an object property.

abstract int mapResourceId(String name, int attributeId)

Map a string name to an integer ID for an attribute that contains resource IDs.

abstract int mapShort(String name, int attributeId)

Map a string name to an integer ID for a primitive short property.

Public methods

mapBoolean

public abstract int mapBoolean (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive boolean property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapByte

public abstract int mapByte (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive byte property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapChar

public abstract int mapChar (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive char property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapColor

public abstract int mapColor (String name, 
                int attributeId)

Map a string name to an integer ID for a color property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

See also:

mapDouble

public abstract int mapDouble (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive double property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapFloat

public abstract int mapFloat (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive float property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapGravity

public abstract int mapGravity (String name, 
                int attributeId)

Map a string name to an integer ID for a gravity property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

See also:

mapInt

public abstract int mapInt (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive int property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapIntEnum

public abstract int mapIntEnum (String name, 
                int attributeId, 
                IntFunction<String> mapping)

Map a string name to an integer ID for an enumeration packed into an int property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

mapping IntFunction: A mapping from int to String This value cannot be null.

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapIntFlag

public abstract int mapIntFlag (String name, 
                int attributeId, 
                IntFunction<Set<String>> mapping)

Map a string name to an integer ID for a flag set packed into an int property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

mapping IntFunction: A mapping from int to a set of strings This value cannot be null.

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapLong

public abstract int mapLong (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive long property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapObject

public abstract int mapObject (String name, 
                int attributeId)

Map a string name to an integer ID for an object property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapResourceId

public abstract int mapResourceId (String name, 
                int attributeId)

Map a string name to an integer ID for an attribute that contains resource IDs.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.

mapShort

public abstract int mapShort (String name, 
                int attributeId)

Map a string name to an integer ID for a primitive short property.

Parameters
name String: The name of the property This value cannot be null.

attributeId int: If the property is from an XML attribute, the resource ID of the property

Returns
int An integer ID for the property

Throws
PropertyMapper.PropertyConflictException If the property name is already mapped as another type.