M - MessageMB - Builderpublic interface DataBuilderProvider<M extends com.google.protobuf.GeneratedMessage,MB extends com.google.protobuf.GeneratedMessage.Builder<MB>>
| Modifier and Type | Method and Description |
|---|---|
MB |
cloneDataBuilder() |
BuilderSyncSetup<MB> |
getBuilderSetup() |
ClosableDataBuilder<MB> |
getDataBuilder(Object consumer)
This method generates a closable data builder wrapper including the
internal builder instance.
|
ClosableDataBuilder<MB> |
getDataBuilder(Object consumer,
boolean notifyChange)
This method generates a closable data builder wrapper including the
internal builder instance.
|
MB cloneDataBuilder()
BuilderSyncSetup<MB> getBuilderSetup()
ClosableDataBuilder<MB> getDataBuilder(Object consumer)
Usage Example:
try (ClosableDataBuilder<MotionSensor.Builder> dataBuilder = getDataBuilder(this)) {
dataBuilder.getInternalBuilder().setMotionState(motion);
} catch (Exception ex) {
throw new CouldNotPerformException("Could not apply data change!", ex);
}
In this example the ClosableDataBuilder.close method is be called
in background after leaving the try brackets.consumer - ClosableDataBuilder<MB> getDataBuilder(Object consumer, boolean notifyChange)
Usage Example:
try (ClosableDataBuilder<MotionSensor.Builder> dataBuilder = getDataBuilder(this)) {
dataBuilder.getInternalBuilder().setMotionState(motion);
} catch (Exception ex) {
throw new CouldNotPerformException("Could not apply data change!", ex);
}
In this example the ClosableDataBuilder.close method is be called
in background after leaving the try brackets.consumer - notifyChange - this flag defines if notifyChange is done after unlocking.Copyright © 2015–2017 openbase.org. All rights reserved.