public interface Instructions
extends java.util.Map<java.lang.String,java.lang.Object>
rendering plans
.
Provides type conversion and default value handling through generic getters and a convenience setter method allowing for chained operations.
get(String, Class)
or get(String, Object)
,
depending on what format the consumer requires.
When getting an object a consumer could ask for an object <T> or for a String
.
The list below shows the availabe conversions between <T> and String, which will
work in both ways (parsing string to retrieve object or serializing the object as string).
Available type conversions between String and <T>:
Boolean
: true if string is "1"Integer
: normal decimal representation "123" using Integer.toString(int)
Float
: normal floating point representation "3.14" using Float.toString(float)
Dimension
: represented as "width,height"Rectangle
: represented as "x,y,width,height"Object.toString()
when converted to string, but cannot be parsed from a stringModifier and Type | Method and Description |
---|---|
<T> T |
get(java.lang.String name,
java.lang.Class<T> type)
Get a named property and
convert it into the given type if necessary. |
<T> T |
get(java.lang.String name,
T defaultValue)
Get a named property and
convert it into the type
given by the defaultValue argument, if necessary. |
<T> Instructions |
set(java.lang.String name,
T value)
Sets the value of a named property.
|
<T> T get(java.lang.String name, java.lang.Class<T> type)
convert it
into the given type if necessary.
If the property is not present or cannot be converted, return null
.name
- The name of the propertytype
- The class of the typenull
if
non existing or cannot be converted.class javadoc for available type conversions
<T> T get(java.lang.String name, T defaultValue)
convert it
into the type
given by the defaultValue argument, if necessary.
If the property is not present or cannot be converted, return the defaultValue.name
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing property is
not converted.class javadoc for available type conversions
<T> Instructions set(java.lang.String name, T value)
This allows chaining by returning the Instructions itself. Note that the object will be stored as is and no conversion will happen.
name
- The name of the propertyvalue
- The value to set.this
to allow for method chaining."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"