public static final class Shape.DerivedBuilder extends Object
Shape
instances.
The builder instance is not thread-safe and must not be used from multiple threads at the
same time.Shape.newBuilder(Shape)
Modifier and Type | Method and Description |
---|---|
Shape.DerivedBuilder |
addConstantProperty(Object key,
Object value,
int flags)
Adds a property with a constant value to the shape.
|
Shape |
build()
Builds a derived shape from the base shape supplied to the constructor using the
configuration of this builder.
|
Shape.DerivedBuilder |
dynamicType(Object dynamicType)
Sets initial dynamic object type identifier.
|
Shape.DerivedBuilder |
shapeFlags(int flags)
Sets initial shape flags (default: 0).
|
public Shape.DerivedBuilder dynamicType(Object dynamicType)
DynamicObjectLibrary.setDynamicType(DynamicObject, Object)
for more
information.dynamicType
- a non-null object type identifierNullPointerException
- if the type is null
IllegalArgumentException
DynamicObjectLibrary.getDynamicType(DynamicObject)
,
DynamicObjectLibrary.setDynamicType(DynamicObject, Object)
public Shape.DerivedBuilder shapeFlags(int flags)
DynamicObjectLibrary.setShapeFlags(DynamicObject, int)
for more information.flags
- an int value in the range from 0 to 255 (inclusive)IllegalArgumentException
- if the flags value is not in the supported rangeDynamicObjectLibrary.getShapeFlags(DynamicObject)
,
DynamicObjectLibrary.setShapeFlags(DynamicObject, int)
public Shape.DerivedBuilder addConstantProperty(Object key, Object value, int flags)
null
and
must not be equal to any previously added property's key.key
- the property's keyvalue
- the property's valueflags
- the property's flagsNullPointerException
- if the key is null
IllegalArgumentException
- if a property with the key already existsDynamicObjectLibrary.putConstant(DynamicObject, Object, Object, int)
public Shape build()