use of com.arm.mbed.cloud.sdk.internal.devicedirectory.model.DevicePage in project mbed-cloud-sdk-java by ARMmbed.
the class DeviceDirectory method listDevicesWithExtraFilters.
protected ListResponse<Device> listDevicesWithExtraFilters(String functionName, DeviceListOptions options, Filter additionalFilter) throws MbedCloudException {
final DeviceListOptions finalOptions = (options == null) ? new DeviceListOptions() : options;
finalOptions.addFilter(additionalFilter);
return CloudCaller.call(this, functionName, DeviceAdapter.getListMapper(), new CloudCall<DevicePage>() {
@Override
public Call<DevicePage> call() {
return endpoint.getDirectory().deviceList(finalOptions.getLimit(), finalOptions.getOrder().toString(), finalOptions.getAfter(), DeviceAdapter.FILTERS_MARSHALLER.encode(finalOptions.getFilter()), finalOptions.encodeInclude());
}
});
}
use of com.arm.mbed.cloud.sdk.internal.devicedirectory.model.DevicePage in project mbed-cloud-sdk-java by ARMmbed.
the class DeviceAdapter method mapList.
/**
* Maps a list of device data.
*
* @param list
* device page
* @return a list of devices
*/
public static ListResponse<Device> mapList(DevicePage list) {
final DevicePage deviceList = list;
final RespList<DeviceData> respList = new RespList<DeviceData>() {
@Override
public Boolean getHasMore() {
return (deviceList == null) ? null : deviceList.isHasMore();
}
@Override
public Integer getTotalCount() {
return (deviceList == null) ? null : deviceList.getTotalCount();
}
@Override
public String getAfter() {
return (deviceList == null) ? null : deviceList.getAfter();
}
@Override
public Integer getLimit() {
return (deviceList == null) ? null : deviceList.getLimit();
}
@Override
public String getOrder() {
return (deviceList == null) ? null : deviceList.getOrder().toString();
}
@Override
public List<DeviceData> getData() {
return (deviceList == null) ? null : deviceList.getData();
}
};
return GenericAdapter.mapList(respList, getMapper());
}
Aggregations