org.apache.streams.pojo.json.Activity.setAdditionalProperty()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(119)

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

Activity.setAdditionalProperty介绍

暂无

代码示例

代码示例来源:origin: apache/streams

public void setExtensions(Activity activity, Map<String, Object> extensions) {
 activity.setAdditionalProperty(extensionProperty, extensions);
}

代码示例来源:origin: apache/streams

/**
 * Creates a standard extension property.
 * @param activity activity to create the property in
 * @return the Map representing the extensions property
 */
@SuppressWarnings("unchecked")
@Deprecated
public static Map<String, Object> ensureExtensions(Activity activity) {
 Map<String, Object> extensions = (Map)activity.getAdditionalProperties().get(EXTENSION_PROPERTY);
 if (extensions == null) {
  extensions = new HashMap<>();
  activity.setAdditionalProperty(EXTENSION_PROPERTY, extensions);
 }
 return extensions;
}

代码示例来源:origin: apache/streams

/**
 * Given a {@link Channel} object and an
 * {@link Activity} object, fill out the appropriate details
 *
 * @param channel Channel
 * @param activity Activity
 * @throws ActivitySerializerException ActivitySerializerException
 */
public static void updateActivity(Channel channel, Activity activity, String channelId) throws ActivitySerializerException {
 try {
  activity.setProvider(getProvider());
  activity.setVerb("post");
  activity.setActor(createActorForChannel(channel));
  Map<String, Object> extensions = new HashMap<>();
  extensions.put("youtube", channel);
  activity.setAdditionalProperty("extensions", extensions);
 } catch (Throwable throwable) {
  throw new ActivitySerializerException(throwable);
 }
}

代码示例来源:origin: apache/streams

FileInputStream testActivityFileStream = new FileInputStream(docPath.toFile());
Activity activity = MAPPER.readValue(testActivityFileStream, Activity.class);
activity.setAdditionalProperty("updated", Boolean.TRUE);
StreamsDatum datum = new StreamsDatum(activity, activity.getVerb());
if( !StringUtils.isEmpty(activity.getObject().getObjectType())) {

代码示例来源:origin: apache/streams

Activity activity = MAPPER.readValue(testActivityFileStream, Activity.class);
Activity update = new Activity();
update.setAdditionalProperty("updated", Boolean.TRUE);
update.setAdditionalProperty("str", "str");
update.setAdditionalProperty("long", 10L);
update.setActor(
  new ActivityObject()

相关文章