Examples of ListField


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

    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

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

    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

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

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

    canonical.setBirthday(new Date());
    canonical.setDrinker(new EnumImpl<Enum.Drinker>(Enum.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

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

    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

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

    JSONArray phoneArray = result.getJSONArray("phoneNumbers");
    assertEquals(3, phoneArray.length());

    for (int i = 0; i < johnDoe.getPhoneNumbers().size(); i++) {
      ListField expectedPhone = johnDoe.getPhoneNumbers().get(i);
      JSONObject actualPhone = phoneArray.getJSONObject(i);
      assertEquals(expectedPhone.getType(), actualPhone.getString("type"));
      assertEquals(expectedPhone.getValue(), actualPhone.getString("value"));
    }

    JSONArray emailArray = result.getJSONArray("emails");
    assertEquals(2, emailArray.length());

    for (int i = 0; i < johnDoe.getEmails().size(); i++) {
      ListField expectedEmail = johnDoe.getEmails().get(i);
      JSONObject actualEmail = emailArray.getJSONObject(i);
      assertEquals(expectedEmail.getType(), actualEmail.getString("type"));
      assertEquals(expectedEmail.getValue(),
          actualEmail.getString("value"));
    }
  }
View Full Code Here

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

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

    canonical.setBirthday(new Date());
    canonical.setDrinker(new EnumImpl<Enum.Drinker>(Enum.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

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

    JSONArray emailArray = result.getJSONArray(Person.Field.EMAILS.toString());
    assertEquals(1, emailArray.length());

    for (int i = 0; i < canonical.getEmails().size(); i++) {
      ListField expectedEmail = canonical.getEmails().get(i);
      JSONObject actualEmail = emailArray.getJSONObject(i);
      assertEquals(expectedEmail.getType(),
          actualEmail.getString(ListField.Field.TYPE.toString()));
      assertEquals(expectedEmail.getValue(),
          actualEmail.getString(ListField.Field.VALUE.toString()));
    }

    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),
        result.getJSONArray(Person.Field.ORGANIZATIONS.toString()).getJSONObject(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(result, canonical.getLookingFor(),
        Person.Field.LOOKING_FOR);
    assertStringListField(result, canonical.getMovies(), Person.Field.MOVIES);
    assertStringListField(result, canonical.getMusic(), Person.Field.MUSIC);

    assertEquals(canonical.getName().getFormatted(),
        result.getJSONObject(Person.Field.NAME.toString()).getString(
            Name.Field.FORMATTED.toString()));

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

    JSONArray phoneArray = result.getJSONArray(
        Person.Field.PHONE_NUMBERS.toString());
    assertEquals(canonical.getPhoneNumbers().size(), phoneArray.length());

    for (int i = 0; i < canonical.getPhoneNumbers().size(); i++) {
      ListField expectedPhone = canonical.getPhoneNumbers().get(i);
      JSONObject actualPhone = phoneArray.getJSONObject(i);
      assertEquals(expectedPhone.getType(), actualPhone.getString(
          ListField.Field.TYPE.toString()));
      assertEquals(expectedPhone.getValue(), actualPhone.getString(
          ListField.Field.VALUE.toString()));
    }

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

Examples of org.springframework.roo.classpath.operations.jsr303.ListField

        Validate.notNull(javaTypeDetails,
                "The type specified, '%s' doesn't exist", typeName);

        final String physicalTypeIdentifier = javaTypeDetails
                .getDeclaredByMetadataId();
        final ListField fieldDetails = new ListField(physicalTypeIdentifier,
                new JavaType(LIST.getFullyQualifiedTypeName(), 0,
                        DataType.TYPE, null, Arrays.asList(fieldType)),
                fieldName, fieldType, cardinality);
        fieldDetails.setNotNull(notNull);
        fieldDetails.setNullRequired(nullRequired);
        if (sizeMin != null) {
            fieldDetails.setSizeMin(sizeMin);
        }
        if (sizeMax != null) {
            fieldDetails.setSizeMax(sizeMax);
        }
        if (mappedBy != null) {
            fieldDetails.setMappedBy(mappedBy);
        }
        if (fetch != null) {
            fieldDetails.setFetch(fetch);
        }
        if (comment != null) {
            fieldDetails.setComment(comment);
        }

        insertField(fieldDetails, permitReservedWords, transientModifier);
    }
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.people.userprofile.model.ListField

        person.setAboutMe("About Me");
        Name personName = new NameImpl();
        personName.setGivenName("Admin");
        personName.setFamilyName("Abcd");
        person.setName(personName);
        ListField email = new ListFieldImpl();
        email.setValue("admin@abcd.org");
        List<ListField> emails = new ArrayList<ListField>();
        emails.add(email);
        person.setEmails(emails);
        ListField telephone = new ListFieldImpl();
        telephone.setValue("99999999");
        List<ListField> teleList = new ArrayList<ListField>();
        teleList.add(telephone);
        person.setPhoneNumbers(teleList);
        personManager.savePerson("admin12", person);
        Person person2;
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.people.userprofile.model.ListField

        person.setAboutMe("About Me");
        Name personName = new NameImpl();
        personName.setGivenName("Admin");
        personName.setFamilyName("Abcd");
        person.setName(personName);
        ListField email = new ListFieldImpl();
        email.setValue("admin@abcd.org");
        List<ListField> emails = new ArrayList<ListField>();
        emails.add(email);
        person.setEmails(emails);
        ListField telephone = new ListFieldImpl();
        telephone.setValue("99999999");
        List<ListField> teleList = new ArrayList<ListField>();
        teleList.add(telephone);
        person.setPhoneNumbers(teleList);
        personManager.savePerson("admin", person);
        Person person2 = personManager.getPerson("admin");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.