public static final class DataPropertyPath.Builder extends Object implements AutoCloseable
Builder
that allows DataPropertyPath
instances to be created.
Typical usage would be create a DataPropertyPath.Builder
using DataPropertyPath#newBuilder
, specifying the origin DataType
. Then specify the properties to follow and finally build()
the data property path. The following snippet shows how this is done for a simple example data property path:
return DataPropertyPath.newBuilder()
.originType(dataType)
.property(someProperty)
.build();
Modifier and Type | Method and Description |
---|---|
DataPropertyPath |
build()
Build the data property path.
|
void |
close() |
protected void |
finalize() |
DataPropertyPath.Builder |
originType(DataType originType)
Sets the type that the created path is associated to.
|
DataPropertyPath.Builder |
property(DataProperty property)
Sets the next property in the path.
|
DataPropertyPath.Builder |
property(String name)
Sets the name of the next property in the path.
|
public void close()
close
in interface AutoCloseable
@NotNull public DataPropertyPath.Builder property(@NotNull DataProperty property) throws IllegalStateException, IllegalArgumentException
property
- the next property in the path.IllegalArgumentException
- if no such property exists in the type that the path currently refers to.IllegalStateException
- If no origin type has been set.@NotNull public DataPropertyPath.Builder property(@NotNull String name) throws IllegalStateException, IllegalArgumentException
name
- the name of the next property in the path.IllegalArgumentException
- if no such property exists in the type that the path currently refers to.IllegalStateException
- If no origin type has been set.@NotNull public DataPropertyPath.Builder originType(@NotNull DataType originType) throws IllegalStateException
Calling this function is mandatory. You have to call this method before setting any property.
originType
- the type that the created path is associated to.IllegalStateException
- if multiple origin type are set.@NotNull public DataPropertyPath build() throws IllegalStateException
After calling this function, this builder should no longer be used.
IllegalStateException
- If not all mandatory parameters are set.