Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (c) SiteWhere, LLC. All rights reserved. http://www.sitewhere.com
  *
  * The software in this package is published under the terms of the CPAL v1.0
  * license, a copy of which has been included with this distribution in the
  * LICENSE.txt file.
  */
 package com.sitewhere.device.marshaling;
 
Configurable helper class that allows com.sitewhere.rest.model.device.DeviceSpecification model objects to be created from com.sitewhere.spi.device.IDeviceSpecification SPI objects.

Author(s):
dadams
Static logger instance
	private static Logger LOGGER = Logger.getLogger(DeviceSpecificationMarshalHelper.class);

Indicates whether device specification asset information is to be included
	private boolean includeAsset = true;

Convert a device specification for marshaling.

Parameters:
source
manager
Returns:
Throws:
com.sitewhere.spi.SiteWhereException
		MetadataProviderEntity.copy(sourcespec);
		spec.setToken(source.getToken());
		spec.setName(source.getName());
		HardwareAsset asset =
						source.getAssetModuleId(), source.getAssetId());
		if (asset == null) {
			.warn("Device specification has reference to non-existent asset.");
		}
		spec.setAssetId(asset.getId());
		spec.setAssetName(asset.getName());
		if (isIncludeAsset()) {
			spec.setAsset(asset);
		}
		return spec;
	}
	public boolean isIncludeAsset() {
		return ;
	}
	public DeviceSpecificationMarshalHelper setIncludeAsset(boolean includeAsset) {
		this. = includeAsset;
		return this;
	}
New to GrepCode? Check out our FAQ X