gpt4 book ai didi

com.sitewhere.rest.model.device.Zone.setSiteToken()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:09:31 26 4
gpt4 key购买 nike

本文整理了Java中com.sitewhere.rest.model.device.Zone.setSiteToken()方法的一些代码示例,展示了Zone.setSiteToken()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.setSiteToken()方法的具体详情如下:
包路径:com.sitewhere.rest.model.device.Zone
类名称:Zone
方法名:setSiteToken

Zone.setSiteToken介绍

暂无

代码示例

代码示例来源:origin: com.sitewhere/sitewhere-mongodb

target.setSiteToken(siteToken);
target.setName(name);
target.setBorderColor(borderColor);

代码示例来源:origin: com.sitewhere/sitewhere-core-api

/**
   * Create a copy of an SPI object. Used by web services for marshaling.
   * 
   * @param input
   * @return
   */
  public static Zone copy(IZone input) throws SiteWhereException {
  Zone result = new Zone();
  result.setToken(input.getToken());
  result.setSiteToken(input.getSiteToken());
  result.setName(input.getName());
  result.setCreatedDate(input.getCreatedDate());
  result.setBorderColor(input.getBorderColor());
  result.setFillColor(input.getFillColor());
  result.setOpacity(input.getOpacity());

  List<Location> coords = new ArrayList<Location>();
  for (ILocation location : input.getCoordinates()) {
    coords.add(Location.copy(location));
  }
  result.setCoordinates(coords);

  MetadataProviderEntity.copy(input, result);
  return result;
  }
}

代码示例来源:origin: com.sitewhere/sitewhere-core

/**
 * Common logic for creating a zone based on an incoming request.
 * 
 * @param source
 * @param siteToken
 * @param uuid
 * @return
 * @throws SiteWhereException
 */
public static Zone zoneCreateLogic(IZoneCreateRequest source, String siteToken, String uuid)
  throws SiteWhereException {
Zone zone = new Zone();
zone.setToken(uuid);
zone.setSiteToken(siteToken);
zone.setName(source.getName());
zone.setBorderColor(source.getBorderColor());
zone.setFillColor(source.getFillColor());
zone.setOpacity(source.getOpacity());
SiteWherePersistence.initializeEntityMetadata(zone);
MetadataProvider.copy(source.getMetadata(), zone);
for (ILocation coordinate : source.getCoordinates()) {
  zone.getCoordinates().add(coordinate);
}
return zone;
}

代码示例来源:origin: com.sitewhere/sitewhere-hbase

@Override
public Zone decodeZone(byte[] payload) throws SiteWhereException {
ByteArrayInputStream stream = new ByteArrayInputStream(payload);
try {
  ProtobufMarshaler.Zone pb = ProtobufMarshaler.Zone.parseFrom(stream);
  Zone zone = new Zone();
  zone.setToken(pb.getToken());
  zone.setSiteToken(pb.getSiteToken());
  zone.setName(pb.getName());
  for (ProtobufMarshaler.Location pbloc : pb.getCoordinatesList()) {
  Location location = new Location();
  location.setLatitude(pbloc.getLatitude());
  location.setLongitude(pbloc.getLongitude());
  if (pbloc.hasElevation()) {
    location.setElevation(pbloc.getElevation());
  }
  zone.getCoordinates().add(location);
  }
  zone.setBorderColor(pb.getBorderColor());
  zone.setFillColor(pb.getFillColor());
  zone.setOpacity(pb.getOpacity());
  loadEntityData(pb.getEntityData(), zone);
  return zone;
} catch (IOException e) {
  throw new SiteWhereException("Unable to unmarshal site.", e);
}
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com