Package com.google.appengine.api.datastore

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


        Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, kinds[i]);
        Entity control = new Entity(childKey);
        control.setProperty(GbControl.KIND_NAME, kinds[i]);
        control.setProperty(GbControl.COUNT, 0);
        if (currentUser != null) {
          control.setProperty(GbControl.REPORT_TO, new Email(currentUser.getEmail()));
        }
        control.setProperty(GbControl.AUTH_SUB_TOKEN, token);
        control.setProperty(GbControl.SPREADSHEET_KEY, spreadsheet.getKey());
        control.setProperty(GbControl.UPDATE_DATE, new Date());
        list.add(control);
View Full Code Here


        Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, wsTitles[i]);
        Entity control = new Entity(childKey);
        control.setProperty(GbControl.KIND_NAME, wsTitles[i]);
        control.setProperty(GbControl.COUNT, 2); // ignore header!
        if (currentUser != null) {
          control.setProperty(GbControl.REPORT_TO, new Email(currentUser.getEmail()));
        }
        control.setProperty(GbControl.AUTH_SUB_TOKEN, token);
        control.setProperty(GbControl.SPREADSHEET_KEY, ssKey);
        control.setProperty(GbControl.UPDATE_DATE, new Date());
        list.add(control);
View Full Code Here

        Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, kinds[i]);
        Entity control = new Entity(childKey);
        control.setProperty(GbControl.KIND_NAME, kinds[i]);
        control.setProperty(GbControl.COUNT, 0);
        if (currentUser != null) {
          control.setProperty(GbControl.REPORT_TO, new Email(currentUser.getEmail()));
        }
        control.setProperty(GbControl.UPDATE_DATE, new Date());
        list.add(control);

        // Start task queue chain for each kind.
View Full Code Here

    } 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)) {
      String[] split = ((String) value).split(" ");
      val = new IMHandle(Scheme.valueOf(split[0]), split[1]);
    } else if (valueType.equals(BLOB_KEY)) {
      val = new BlobKey((String) value);
View Full Code Here

     * Also converts single String to String array with one element.
     * @return String converted to given object if possible
     */
    public static <T> T asType(String self, Class<T> clazz) {
        if (clazz == Email.class)
            return clazz.cast(new Email(self));
        if (clazz == Text.class)
            return clazz.cast(new Text(self));
        if (clazz == BlobKey.class)
            return clazz.cast(new BlobKey(self));
        if (clazz == Link.class)
View Full Code Here

            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

        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"),
            new Link("http://www.gmail.com")};
        Category[] categoryDat = {new Category("developer"), new Category("test"),
            new Category("manager")};
        Text[] textDat = {new Text("english"), new Text("chinese"), new Text("japanese")};
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()));
        String[] inDat = {"abc", "xyz"};
        doInFilter(kindName, "stringProp", inDat);
View Full Code Here

    @Test
    public void testEmailType() {
        String propertyName = "emailProp";
        List<Entity> elist = doQuery(kindName, propertyName, Email.class, true);
        Email email = (Email) elist.get(0).getProperty(propertyName);
        Email sameDat = (Email) elist.get(0).getProperty(propertyName);
        Email diffDat = (Email) elist.get(1).getProperty(propertyName);
        assertTrue(email.equals(sameDat));
        assertFalse(email.equals(diffDat));
        assertEquals("somebody2@gmail.com", email.getEmail());
        assertEquals(0, email.compareTo(sameDat));
        assertTrue(email.compareTo(diffDat) != 0);
View Full Code Here

            newRec.setProperty("intData", 20 * i);
            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));
View Full Code Here

TOP

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

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.