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

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

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

Activity.<init>介绍

暂无

代码示例

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

@Override
public List<Activity> toActivityList(Media item) throws ActivityConversionException {
 Activity activity = new Activity();
 updateActivity(item, activity);
 return Collections.singletonList(activity);
}

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

@Override
public Activity deserialize(Post post) throws ActivitySerializerException {
 Activity activity = new Activity();
 FacebookActivityUtil.updateActivity(post, activity);
 return activity;
}

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

@Override
public Activity deserialize(Page page) throws ActivitySerializerException {
 Activity activity = new Activity();
 FacebookActivityUtil.updateActivity(page, activity);
 return activity;
}

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

@Override
public Activity deserialize(com.google.api.services.plus.model.Activity gplusActivity) {
 Activity activity = new Activity();
 GooglePlusActivityUtil.updateActivity(gplusActivity, activity);
 return activity;
}

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

activity = new Activity();
 GooglePlusActivityUtil.updateActivity((Person) item, activity);
} else if (item instanceof com.google.api.services.plus.model.Activity) {
 activity = new Activity();
 GooglePlusActivityUtil.updateActivity((com.google.api.services.plus.model.Activity) item, activity);

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

activity = new Activity();
 YoutubeActivityUtil.updateActivity((Video)item, activity, streamsDatum.getId());
} else if (item instanceof Channel) {
 activity = new Activity();
 YoutubeActivityUtil.updateActivity((Channel)item, activity, null);
} else {

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

@Override
public Activity deserialize(Post post) throws ActivitySerializerException {
 Activity activity = new Activity();
 activity.setActor(createActor(post));
 activity.setId(post.getId());
 activity.setContent(post.getMessage());
 return null;
}

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

Objects.requireNonNull(entry);
Activity activity = new Activity();
Provider provider = buildProvider(entry);
ActivityObject actor = buildActor(entry);

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

/**
 * convert BeatApi.BeatResponse.Beat to Activity
 * @param beat BeatApi.BeatResponse.Beat
 * @return Activity
 */
public Activity convert(BeatApi.BeatResponse.Beat beat) {
 Activity converted = new Activity();
 converted.setId(beat.getDocid());
 converted.setVerb("post");
 converted.setContent(beat.getContent());
 converted.setTitle(beat.getTitle());
 converted.setPublished(new DateTime(beat.getTime()));
 converted.setUrl(beat.getLink());
 converted.setActor(new ActivityObject());
 Map<String, Object> extensions = ExtensionUtil.getInstance().ensureExtensions(converted);
 extensions.put("keywords", beat.getContent());
 setLocation(beat, extensions);
 setObject(beat, converted);
 setProvider(beat, converted);
 Map<String, BeatApi.BeatResponse.Beat.Tag> mappedTags = mapTags(beat);
 setLanguage(mappedTags, extensions);
 extensions.put("sysomos", beat);
 setChannelSpecificValues(beat, converted, mappedTags);
 return converted;
}

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

@Override
public Activity deserialize(GmailMessage gmailMessage) {
 Activity activity = new Activity();
 activity.setId(formatId(this.provider.getConfig().getUserName(), String.valueOf(gmailMessage.getMessageNumber())));
 activity.setPublished(new DateTime(gmailMessage.getSendDate()));
 Provider provider = new Provider();
 provider.setId("http://gmail.com");
 provider.setDisplayName("GMail");
 activity.setProvider(provider);
 ActivityObject actor = new ActivityObject();
 actor.setId(gmailMessage.getFrom().getEmail());
 actor.setDisplayName(gmailMessage.getFrom().getName());
 activity.setActor(actor);
 activity.setVerb("email");
 ActivityObject object = new ActivityObject();
 try {
  object.setId(gmailMessage.getTo().get(0).getEmail());
  object.setDisplayName(gmailMessage.getTo().get(0).getName());
 } catch (GmailException e) {
  LOGGER.warn(e.getMessage());
 }
 activity.setTitle(gmailMessage.getSubject());
 try {
  activity.setContent(gmailMessage.getContentText());
 } catch (GmailException e) {
  LOGGER.warn(e.getMessage());
 }
 activity.setObject(object);
 return activity;
}

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

FileInputStream testActivityFileStream = new FileInputStream(docPath.toFile());
Activity activity = MAPPER.readValue(testActivityFileStream, Activity.class);
Activity update = new Activity();
update.setAdditionalProperty("updated", Boolean.TRUE);
update.setAdditionalProperty("str", "str");

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

/**
 * convert article into Activity.
 * @param article article
 * @return Activity
 */
public static Activity convert(Article article) {
 Activity activity = new Activity();
 Source source = article.getSource();
 activity.setActor(convert(article.getAuthor(), source.getName()));
 activity.setProvider(convert(source));
 activity.setTarget(convertTarget(source));
 activity.setObject(convertObject(article));
 activity.setPublished(DateTime.parse(article.getPublishedDate()));
 activity.setContent(article.getContent());
 activity.setTitle(article.getTitle());
 activity.setVerb("posted");
 fixActivityId(activity);
 addLocationExtension(activity, source);
 addLanguageExtension(activity, article);
 activity.setLinks(convertLinks(article));
 return activity;
}

相关文章