gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-18 00:33:31 26 4
gpt4 key购买 nike

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

Zone.setBounds介绍

暂无

代码示例

代码示例来源:origin: sitewhere/sitewhere

/**
 * Copy information from Mongo {@link Document} to model object.
 * 
 * @param source
 * @param target
 */
public static void fromDocument(Document source, Zone target) {
UUID areaId = (UUID) source.get(PROP_AREA_ID);
String name = (String) source.get(PROP_NAME);
String borderColor = (String) source.get(PROP_BORDER_COLOR);
String fillColor = (String) source.get(PROP_FILL_COLOR);
Double opacity = (Double) source.get(PROP_OPACITY);
target.setAreaId(areaId);
target.setName(name);
target.setBorderColor(borderColor);
target.setFillColor(fillColor);
target.setOpacity(opacity);
target.setBounds(MongoBoundedEntity.loadBounds(source));
MongoPersistentEntity.fromDocument(source, target);
}

代码示例来源:origin: sitewhere/sitewhere

/**
 * Convert zone from GRPC to API.
 * 
 * @param grpc
 * @return
 * @throws SiteWhereException
 */
public static Zone asApiZone(GZone grpc) throws SiteWhereException {
Zone api = new Zone();
api.setName(grpc.getName());
api.setBounds(CommonModelConverter.asApiLocations(grpc.getBoundsList()));
api.setFillColor(grpc.getFillColor());
api.setBorderColor(grpc.getBorderColor());
api.setOpacity(grpc.getOpacity());
CommonModelConverter.setEntityInformation(api, grpc.getEntityInformation());
return api;
}

代码示例来源:origin: sitewhere/sitewhere

/**
 * Common logic for creating a zone based on an incoming request.
 * 
 * @param request
 * @param area
 * @param uuid
 * @return
 * @throws SiteWhereException
 */
public static Zone zoneCreateLogic(IZoneCreateRequest request, IArea area, String uuid) throws SiteWhereException {
Zone zone = new Zone();
Persistence.entityCreateLogic(request, zone);
zone.setAreaId(area.getId());
zone.setName(request.getName());
zone.setBorderColor(request.getBorderColor());
zone.setFillColor(request.getFillColor());
zone.setOpacity(request.getOpacity());
zone.setBounds(Location.copy(request.getBounds()));
return zone;
}

代码示例来源:origin: sitewhere/sitewhere

/**
 * Common code for copying information from an update request to an existing
 * zone.
 * 
 * @param request
 * @param target
 * @throws SiteWhereException
 */
public static void zoneUpdateLogic(IZoneCreateRequest request, Zone target) throws SiteWhereException {
Persistence.entityUpdateLogic(request, target);
if (request.getName() != null) {
  target.setName(request.getName());
}
if (request.getBorderColor() != null) {
  target.setBorderColor(request.getBorderColor());
}
if (request.getFillColor() != null) {
  target.setFillColor(request.getFillColor());
}
if (request.getOpacity() != null) {
  target.setOpacity(request.getOpacity());
}
if (request.getBounds() != null) {
  target.setBounds(Location.copy(request.getBounds()));
}
}

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

/**
   * 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.setId(input.getId());
  result.setToken(input.getToken());
  result.setAreaId(input.getAreaId());
  result.setName(input.getName());
  result.setCreatedDate(input.getCreatedDate());
  result.setBorderColor(input.getBorderColor());
  result.setFillColor(input.getFillColor());
  result.setOpacity(input.getOpacity());
  result.setBounds(Location.copy(input.getBounds()));

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

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