Package org.apache.shindig.social.opensocial.model

Examples of org.apache.shindig.social.opensocial.model.ListField


    ListField photo = getListFieldWithType(THUMBNAIL_PHOTO_TYPE, getPhotos());
    return photo == null ? null : photo.getValue();
  }

  public void setThumbnailUrl(String thumbnailUrl) {
    ListField photo = getListFieldWithType(THUMBNAIL_PHOTO_TYPE, getPhotos());
    if (photo != null) {
      photo.setValue(thumbnailUrl);
    } else {
      setPhotos(addListField(new ListFieldDb(THUMBNAIL_PHOTO_TYPE, thumbnailUrl), getPhotos()));
    }
  }
View Full Code Here


        setUrls(addListField(new UrlImpl(profileUrl, null, PROFILE_URL_TYPE), getUrls()));
    }
  }

  public String getThumbnailUrl() {
    ListField photo = getListFieldWithType(THUMBNAIL_PHOTO_TYPE, getPhotos());
    return photo == null ? null : photo.getValue();
  }
View Full Code Here

    location.setLongitude(2.29419F);
    canonical.setCurrentLocation(location);

    canonical.setBirthday(new Date());
    canonical.setDrinker(new EnumImpl<Drinker>(Drinker.SOCIALLY));
    ListField email = new ListFieldImpl("work",
        "shindig-dev@incubator.apache.org");
    canonical.setEmails(Lists.newArrayList(email));

    canonical.setEthnicity("developer");
    canonical.setFashion("t-shirts");
View Full Code Here

    ListField photo = getListFieldWithType(THUMBNAIL_PHOTO_TYPE, getPhotos());
    return photo == null ? null : photo.getValue();
  }

  public void setThumbnailUrl(String thumbnailUrl) {
    ListField photo = getListFieldWithType(THUMBNAIL_PHOTO_TYPE, getPhotos());
    if (photo != null) {
      photo.setValue(thumbnailUrl);
    } else {
      if (thumbnailUrl != null)
        setPhotos(addListField(new ListFieldImpl(THUMBNAIL_PHOTO_TYPE, thumbnailUrl), getPhotos()));
    }
  }
View Full Code Here

    List<Node> emailArray = childNodeMap.get(Person.Field.EMAILS.toString());
    assertEquals(1, emailArray.size());

    for (int i = 0; i < canonical.getEmails().size(); i++) {
      ListField expectedEmail = canonical.getEmails().get(i);
      Map<String, List<String>> actualEmail = childNodesToMap(emailArray.get(i));

      assertStringField(actualEmail, expectedEmail.getType(),
          ListField.Field.TYPE);
      assertStringField(actualEmail, expectedEmail.getValue(),
          ListField.Field.VALUE);
    }

    assertStringField(result, canonical.getEthnicity(), Person.Field.ETHNICITY);
    assertStringField(result, canonical.getFashion(), Person.Field.FASHION);
    assertStringListField(result, canonical.getFood(), Person.Field.FOOD);
    assertStringField(result, canonical.getGender().toString(),
        Person.Field.GENDER);
    assertStringField(result, canonical.getHappiestWhen(),
        Person.Field.HAPPIEST_WHEN);
    assertBooleanField(result, canonical.getHasApp(), Person.Field.HAS_APP);
    assertStringListField(result, canonical.getHeroes(), Person.Field.HEROES);
    assertStringField(result, canonical.getHumor(), Person.Field.HUMOR);
    assertStringField(result, canonical.getId(), Person.Field.ID);
    assertStringListField(result, canonical.getInterests(),
        Person.Field.INTERESTS);
    assertStringField(result, canonical.getJobInterests(),
        Person.Field.JOB_INTERESTS);

    assertOrganizationField(canonical.getOrganizations().get(0), childNodeMap
        .get(Person.Field.ORGANIZATIONS.toString()).get(0));

    assertStringListField(result, canonical.getLanguagesSpoken(),
        Person.Field.LANGUAGES_SPOKEN);
    // assertDateField(result, canonical.getUpdated(),
    // Person.Field.LAST_UPDATED);
    assertStringField(result, canonical.getLivingArrangement(),
        Person.Field.LIVING_ARRANGEMENT);
    assertListEnumField(childNodeMap, canonical.getLookingFor(),
        Person.Field.LOOKING_FOR);
    assertStringListField(result, canonical.getMovies(), Person.Field.MOVIES);
    assertStringListField(result, canonical.getMusic(), Person.Field.MUSIC);

    assertEquals(canonical.getName().getFormatted(), childNodesToMap(
        childNodeMap.get(Person.Field.NAME.toString()).get(0)).get(
        Name.Field.FORMATTED.toString()).get(0));

    assertEnumField(childNodeMap, canonical.getNetworkPresence(),
        Person.Field.NETWORKPRESENCE);
    assertStringField(result, canonical.getNickname(), Person.Field.NICKNAME);
    assertStringField(result, canonical.getPets(), Person.Field.PETS);

    List<Node> phoneArray = childNodeMap.get(Person.Field.PHONE_NUMBERS
        .toString());
    assertEquals(canonical.getPhoneNumbers().size(), phoneArray.size());

    for (int i = 0; i < canonical.getPhoneNumbers().size(); i++) {
      ListField expectedPhone = canonical.getPhoneNumbers().get(i);
      Map<String, List<String>> actualPhone = childNodesToMap(phoneArray.get(i));
      assertEquals(expectedPhone.getType(), actualPhone.get(
          ListField.Field.TYPE.toString()).get(0));
      assertEquals(expectedPhone.getValue(), actualPhone.get(
          ListField.Field.VALUE.toString()).get(0));
    }

    assertStringField(result, canonical.getPoliticalViews(),
        Person.Field.POLITICAL_VIEWS);
View Full Code Here

    location.setLongitude(2.29419F);
    canonical.setCurrentLocation(location);

    canonical.setBirthday(buildDate("1975-01-01"));
    canonical.setDrinker(new EnumImpl<Drinker>(Drinker.SOCIALLY));
    ListField email = new ListFieldImpl("work", "shindig-dev@incubator.apache.org");
    canonical.setEmails(Lists.newArrayList(email));

    canonical.setEthnicity("developer");
    canonical.setFashion("t-shirts");
    canonical.setFood(Lists.newArrayList("sushi", "burgers"));
View Full Code Here

    return null;
  }

  private ListField getNewEmail(int i) {
    String targetAddress = "xyz" + i + "@testdataset.com";
    ListField email = findOne(EmailDb.FINDBY_EMAIL, new String[] { EmailDb.PARAM_EMAIL },
        new Object[] { targetAddress });
    if (email == null) {
      email = new EmailDb();
      email.setValue(targetAddress);
      email.setType("emailType");
    }
    return email;
  }
View Full Code Here

    location.setLongitude(2.29419F);
    canonical.setCurrentLocation(location);

    canonical.setBirthday(new Date());
    canonical.setDrinker(new EnumImpl<Drinker>(Drinker.SOCIALLY));
    ListField email = new ListFieldImpl("work",
        "dev@shindig.apache.org");
    canonical.setEmails(Lists.newArrayList(email));

    canonical.setEthnicity("developer");
    canonical.setFashion("t-shirts");
View Full Code Here

    List<Node> emailArray = childNodeMap.get(Person.Field.EMAILS.toString());
    assertEquals(1, emailArray.size());

    for (int i = 0; i < canonical.getEmails().size(); i++) {
      ListField expectedEmail = canonical.getEmails().get(i);
      Map<String, List<String>> actualEmail = childNodesToMap(emailArray.get(i));

      assertStringField(actualEmail, expectedEmail.getType(),
          ListField.Field.TYPE);
      assertStringField(actualEmail, expectedEmail.getValue(),
          ListField.Field.VALUE);
    }

    assertStringField(result, canonical.getEthnicity(), Person.Field.ETHNICITY);
    assertStringField(result, canonical.getFashion(), Person.Field.FASHION);
    assertStringListField(result, canonical.getFood(), Person.Field.FOOD);
    assertStringField(result, canonical.getGender().toString(),
        Person.Field.GENDER);
    assertStringField(result, canonical.getHappiestWhen(),
        Person.Field.HAPPIEST_WHEN);
    assertBooleanField(result, canonical.getHasApp(), Person.Field.HAS_APP);
    assertStringListField(result, canonical.getHeroes(), Person.Field.HEROES);
    assertStringField(result, canonical.getHumor(), Person.Field.HUMOR);
    assertStringField(result, canonical.getId(), Person.Field.ID);
    assertStringListField(result, canonical.getInterests(),
        Person.Field.INTERESTS);
    assertStringField(result, canonical.getJobInterests(),
        Person.Field.JOB_INTERESTS);

    assertOrganizationField(canonical.getOrganizations().get(0), childNodeMap
        .get(Person.Field.ORGANIZATIONS.toString()).get(0));

    assertStringListField(result, canonical.getLanguagesSpoken(),
        Person.Field.LANGUAGES_SPOKEN);
    // assertDateField(result, canonical.getUpdated(),
    // Person.Field.LAST_UPDATED);
    assertStringField(result, canonical.getLivingArrangement(),
        Person.Field.LIVING_ARRANGEMENT);
    assertListEnumField(childNodeMap, canonical.getLookingFor(),
        Person.Field.LOOKING_FOR);
    assertStringListField(result, canonical.getMovies(), Person.Field.MOVIES);
    assertStringListField(result, canonical.getMusic(), Person.Field.MUSIC);

    assertEquals(canonical.getName().getFormatted(), childNodesToMap(
        childNodeMap.get(Person.Field.NAME.toString()).get(0)).get(
        Name.Field.FORMATTED.toString()).get(0));

    assertEnumField(childNodeMap, canonical.getNetworkPresence(),
        Person.Field.NETWORKPRESENCE);
    assertStringField(result, canonical.getNickname(), Person.Field.NICKNAME);
    assertStringField(result, canonical.getPets(), Person.Field.PETS);

    List<Node> phoneArray = childNodeMap.get(Person.Field.PHONE_NUMBERS
        .toString());
    assertEquals(canonical.getPhoneNumbers().size(), phoneArray.size());

    for (int i = 0; i < canonical.getPhoneNumbers().size(); i++) {
      ListField expectedPhone = canonical.getPhoneNumbers().get(i);
      Map<String, List<String>> actualPhone = childNodesToMap(phoneArray.get(i));
      assertEquals(expectedPhone.getType(), actualPhone.get(
          ListField.Field.TYPE.toString()).get(0));
      assertEquals(expectedPhone.getValue(), actualPhone.get(
          ListField.Field.VALUE.toString()).get(0));
    }

    assertStringField(result, canonical.getPoliticalViews(),
        Person.Field.POLITICAL_VIEWS);
View Full Code Here

    location.setLongitude(2.29419F);
    canonical.setCurrentLocation(location);

    canonical.setBirthday(new Date());
    canonical.setDrinker(new EnumImpl<Drinker>(Drinker.SOCIALLY));
    ListField email = new ListFieldImpl("work", "dev@shindig.apache.org");
    canonical.setEmails(Lists.newArrayList(email));

    canonical.setEthnicity("developer");
    canonical.setFashion("t-shirts");
    canonical.setFood(Lists.newArrayList("sushi", "burgers"));
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.model.ListField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.