本文整理匯總了Java中com.google.api.services.mirror.model.Command類的典型用法代碼示例。如果您正苦於以下問題:Java Command類的具體用法?Java Command怎麽用?Java Command使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Command類屬於com.google.api.services.mirror.model包,在下文中一共展示了Command類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: insertContact
import com.google.api.services.mirror.model.Command; //導入依賴的package包/類
@RequestMapping(value = "/insertContact")
public ModelAndView insertContact(@RequestParam("id") String id, @RequestParam("name") String name, @RequestParam("name") String iconUrl) throws IOException {
String info = "";
logger.info("Inserting Contact");
Contact contact = new Contact();
contact.setId(id);
contact.setDisplayName(name);
contact.setImageUrls(Lists.newArrayList(iconUrl));
contact.setAcceptCommands(Lists.newArrayList(new Command().setType("TAKE_A_NOTE")));
mirrorTemplate.insertContact(contact);
info = "Contact has been inserted:" + name;
ModelAndView mav = new ModelAndView("info");
mav.addObject("message", info);
return mav;
}
示例2: bootstrapNewUser
import com.google.api.services.mirror.model.Command; //導入依賴的package包/類
private void bootstrapNewUser(HttpServletRequest req, String userId) throws IOException {
// Create contact
Contact starterProjectContact = new Contact();
starterProjectContact.setId(CONTACT_ID);
starterProjectContact.setDisplayName(CONTACT_NAME);
starterProjectContact.setImageUrls(Lists.newArrayList("http://www.eteration.com/wp-content/themes/responsive/images/banner/slider-bg-academy.png"));
starterProjectContact.setAcceptCommands(Lists.newArrayList(new Command().setType("TAKE_A_NOTE")));
Contact insertedContact = mirrorTemplate.insertContact(starterProjectContact);
logger.info("Bootstrapper inserted contact " + insertedContact.getId() + " for user " + userId);
}