Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.PhoneNumber


    case LONG:
      return ((LongPropertyInfo) info).getPayload();
    case NULL:
      return null;
    case PHONE_NO:
      return new PhoneNumber(((PhoneNumberPropertyInfo) info).getPayload());
    case POSTTAL_ADDRESS:
      return new PostalAddress(((PostalAddressPropertyInfo) info).getPayload());
    case SHORT_BLOB:
      return new ShortBlob(((ShortBlobPropertyInfo) info).getPayload().getBytes());
    case STRING:
View Full Code Here


   *
   * @throws Exception
   */
  @Test
  public void testPhoneNumber() throws Exception {
    assertEquals(new PhoneNumber("abcde"),
        parser("phonenumber('abcde')").bool_exp().e.evaluate(null).getPayload());
  }
View Full Code Here

    } else if (valueType.equals(CATEGORY)) {
      val = new Category((String) value);
    } else if (valueType.equals(RATING)) {
      val = new Rating(Integer.parseInt((String) value));
    } else if (valueType.equals(PHONE_NUMBER)) {
      val = new PhoneNumber((String) value);
    } else if (valueType.equals(POSTAL_ADDRESS)) {
      val = new PostalAddress((String) value);
    } else if (valueType.equals(EMAIL)) {
      val = new Email((String) value);
    } else if (valueType.equals(IMHANDLE)) {
View Full Code Here

        if (clazz == Link.class)
            return clazz.cast(new Link(self));
        if (clazz == Category.class)
            return clazz.cast(new Category(self));
        if (clazz == PhoneNumber.class)
            return clazz.cast(new PhoneNumber(self));
        if (clazz == PostalAddress.class)
            return clazz.cast(new PostalAddress(self));
        if (clazz == Rating.class)
            return clazz.cast(new Rating(Integer.valueOf(self)));
        if (clazz == JID.class)
View Full Code Here

        assertEquals(entity2.getKey(), list.get(0).getKey());
    }

    @Test
    public void testPhoneNumberProperty() {
        testEqualityQueries(new PhoneNumber("foo"), new PhoneNumber("bar"));
        testInequalityQueries(new PhoneNumber("111"), new PhoneNumber("222"), new PhoneNumber("333"));
    }
View Full Code Here

            asSet(true),
            asSet(
                "sip sip",
                new ShortBlob("sip sip".getBytes()),
                new PostalAddress("sip sip"),
                new PhoneNumber("sip sip"),
                new Email("sip sip"),
                new IMHandle(IMHandle.Scheme.sip, "sip"),   // this is stored as "sip sip"
                new Link("sip sip"),
                new Category("sip sip"),
                new BlobKey("sip sip")
            ),
            asSet(
                "xmpp xmpp",
                new ShortBlob("xmpp xmpp".getBytes()),
                new PostalAddress("xmpp xmpp"),
                new PhoneNumber("xmpp xmpp"),
                new Email("xmpp xmpp"),
                new IMHandle(IMHandle.Scheme.xmpp, "xmpp"), // this is stored as "xmpp xmpp"
                new Link("xmpp xmpp"),
                new Category("xmpp xmpp"),
                new BlobKey("xmpp xmpp")
View Full Code Here

    @Before
    public void createData() throws InterruptedException {
        Entity newRec;
        String[] stringDat = {"abc", "xyz", "mno"};
        PhoneNumber[] phoneDat = {new PhoneNumber("408-123-4567"), new PhoneNumber("650-321-7654"),
            new PhoneNumber("408-987-6543")};
        PostalAddress[] addressDat = {new PostalAddress("123 Google Rd. CA 12345"),
            new PostalAddress("19451 Via Monte Rd. CA95070"), new PostalAddress("9 1st St. CA 95000")};
        Email[] emailDat = {new Email("somebody@google.com"), new Email("somebody2@gmail.com"),
            new Email("somebody3@hotmail.com")};
        Link[] linkDat = {new Link("http://www.hotmail.com"), new Link("http://www.google.com.com"),
View Full Code Here

    }

    @Test
    public void testFilter() {
        doAllFilters(kindName, "stringProp", "mno");
        doEqOnlyFilter(kindName, "phoneProp", new PhoneNumber("650-321-7654"));
        doEqOnlyFilter(kindName, "addressProp", new PostalAddress("19451 Via Monte Rd. CA95070"));
        doEqOnlyFilter(kindName, "emailProp", new Email("somebody2@gmail.com"));
        doEqOnlyFilter(kindName, "linkProp", new Link("http://www.google.com.com"));
        doEqOnlyFilter(kindName, "categoryProp", new Category("test"));
        doEqOnlyFilter(kindName, "byteStrProp", new ShortBlob("shortText".getBytes()));
View Full Code Here

    @Test
    public void testPhoneNumType() {
        String propertyName = "phoneProp";
        List<Entity> elist = doQuery(kindName, propertyName, PhoneNumber.class, true);
        PhoneNumber phonenum = (PhoneNumber) elist.get(0).getProperty(propertyName);
        PhoneNumber sameDat = (PhoneNumber) elist.get(0).getProperty(propertyName);
        PhoneNumber diffDat = (PhoneNumber) elist.get(1).getProperty(propertyName);
        assertTrue(phonenum.equals(sameDat));
        assertFalse(phonenum.equals(diffDat));
        assertEquals("408-123-4567", phonenum.getNumber());
        assertEquals(0, phonenum.compareTo(sameDat));
        assertTrue(phonenum.compareTo(diffDat) != 0);
View Full Code Here

            newRec.setProperty("textData", new Text("textData" + i));
            newRec.setProperty("floatData", 1234 + 0.1 * i);
            newRec.setProperty("booleanData", true);
            newRec.setProperty("urlData", new Link("http://www.google.com"));
            newRec.setProperty("emailData", new Email("somebody123" + i + "@google.com"));
            newRec.setProperty("phoneData", new PhoneNumber("408-123-000" + i));
            newRec.setProperty("adressData", new PostalAddress("123 st. CA 12345" + i));
            newRec.setProperty("ratingData", new Rating(10 * i));
            newRec.setProperty("geoptData", new GeoPt((float) (i + 0.12), (float) (i + 0.98)));
            newRec.setProperty("categoryData", new Category("category" + i));
            newRec.setProperty("intList", Arrays.asList(i, 50 + i, 90 + i));
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.PhoneNumber

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.