public class PropertyCommandData extends Object
CompletableFuture<Property>
and a cached Property
.
The CompletableFuture<Property>
represents a request over the network to
read/write the Property
, which may complete at some point in the future.
The cached Property
represents the last known value of the Property
, and
will contain a value before the CompletableFuture<Property>
completes.
This structure allows users to obtain a value immediately if they want, while also waiting on a refreshed value from the network.
Constructor and Description |
---|
PropertyCommandData(CompletableFuture<Property> future) |
PropertyCommandData(CompletableFuture<Property> future,
Property cachedProperty) |
Modifier and Type | Method and Description |
---|---|
Optional<Property> |
getCachedProperty()
Get the last known value of the Property.
|
CompletableFuture<Property> |
getFuture()
Gets the CompletableFuture representing the request to read/write the Property.
|
public PropertyCommandData(CompletableFuture<Property> future)
public PropertyCommandData(CompletableFuture<Property> future, Property cachedProperty)
public CompletableFuture<Property> getFuture()
The future can be waited on, or handled when it completes, to get the result of the Property request over the network.
CompletableFuture<Property>
representing the request
over the network to read/write Property.Copyright © 2021. All rights reserved.