Package com.google.appengine.api.datastore

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


    EvaluationResult r1 = ops.get(1).evaluate(record);
   
    if (r0.getPayload() instanceof String && r1.getPayload() instanceof String) {
      try {
        Scheme scheme = Scheme.valueOf((String) r0.getPayload());
        IMHandle val = new IMHandle(scheme, (String)r1.getPayload());
        return new EvaluationResult(val, r0, r1);
      } catch (IllegalArgumentException e) {
        // input protocol does not match enum Scheme
        return r0.withWarning(ErrorCode.W142);
      }
View Full Code Here


      entity.setProperty("Category", new Category(RandomStringUtils.randomAlphabetic(3)));
      entity.setProperty("Email", new Email("test@example"));
      entity.setProperty("GeoPt", new GeoPt(new Float(new Integer(RandomStringUtils
        .randomNumeric(2)) - 9), new Float(
        new Integer(RandomStringUtils.randomNumeric(2)) - 9)));
      entity.setProperty("IMHandle", new IMHandle(Scheme.valueOf("sip"), RandomStringUtils
        .randomAlphabetic(2)));
      entity.setProperty("Link", new Link("test"));
      entity.setProperty("PhoneNumber", new PhoneNumber(RandomStringUtils.randomNumeric(11)));
      entity.setProperty("PostalAddress", new PostalAddress(RandomStringUtils
        .randomNumeric(7)));
View Full Code Here

      entity.setProperty("Category", new Category(RandomStringUtils.randomAlphabetic(3)));
      entity.setProperty("Email", new Email("test@example"));
      entity.setProperty("GeoPt", new GeoPt(new Float(new Integer(RandomStringUtils
        .randomNumeric(2)) - 9), new Float(
        new Integer(RandomStringUtils.randomNumeric(2)) - 9)));
      entity.setProperty("IMHandle", new IMHandle(Scheme.valueOf("sip"), RandomStringUtils
        .randomAlphabetic(2)));
      entity.setProperty("Link", new Link("test"));
      entity.setProperty("PhoneNumber", new PhoneNumber(RandomStringUtils.randomNumeric(11)));
      entity.setProperty("PostalAddress", new PostalAddress(RandomStringUtils
        .randomNumeric(7)));
View Full Code Here

    entity.setProperty(GbProperty.PHONE_NUMBER, new PhoneNumber(RandomStringUtils
      .randomNumeric(11)));
    entity.setProperty(GbProperty.POSTAL_ADDRESS, new PostalAddress(RandomStringUtils
      .randomNumeric(7)));
    entity.setProperty(GbProperty.EMAIL, new Email(RandomStringUtils.randomAlphanumeric(20)));
    entity.setProperty(GbProperty.IMHANDLE, new IMHandle(
      Scheme.valueOf("sip"),
      RandomStringUtils.randomAlphabetic(2)));
    entity.setProperty(GbProperty.BLOB_KEY, new BlobKey(RandomStringUtils
      .randomAlphanumeric(10)));
View Full Code Here

    public IMHandle decode(JsonReader reader, IMHandle defaultValue) {
        String address = reader.readProperty("address");
        String protocol = reader.readProperty("protocol");
        if(address != null && protocol != null){
            try{
                return new IMHandle(
                    Scheme.valueOf(protocol)
                    , address);
            } catch(IllegalArgumentException e){
            }
            try{
                return new IMHandle(
                    new URL(protocol)
                    , address);
            } catch(MalformedURLException e){
            }
        }
View Full Code Here

      return pa.getAddress();
    } else if (obj instanceof PhoneNumber) {
      PhoneNumber number = (PhoneNumber) obj;
      return number.getNumber();
    } else if (obj instanceof IMHandle) {
      IMHandle imh = (IMHandle) obj;
      return imh.getProtocol().replaceAll("\\|", "\\|") + "|" // \\\\|
          + imh.getAddress().replaceAll("\\|", "\\|");// \\\\|
    } else if (obj instanceof GeoPt) {
      GeoPt gpt = (GeoPt) obj;
      return gpt.getLatitude() + "|" + gpt.getLongitude();
    } else if (obj instanceof User) {
      User usr = (User) obj;
View Full Code Here

      } else if (obj == IMHandle.class) {
        String[] arguments = split(args, '|');
        if (args.length() != 2) {
          return null;
        }
        return new IMHandle(Scheme.valueOf(arguments[0].replaceAll(
            "\\|", "|")), arguments[1].replaceAll("\\|", "|"));// "\\\\|","\\|"
      } else if (obj == GeoPt.class) {
        String[] arguments = args.split("\\|");
        if (arguments.length != 2) {
          return null;
View Full Code Here

      public void enablementChanged(boolean isEnabled) {

      }

      public void valueChanged(ISetDelta<Object> valueElements) {
        IMHandle value = new IMHandle((Scheme) binding3.getValue(),
            (String) binding2.getValue());
        binding.setValueSilent(value);
      }
    };
View Full Code Here

    public IMHandle decode(JsonReader reader, IMHandle defaultValue) {
        String address = reader.readProperty("address");
        String protocol = reader.readProperty("protocol");
        if(address != null && protocol != null){
            try{
                return new IMHandle(
                    Scheme.valueOf(protocol)
                    , address);
            } catch(IllegalArgumentException e){
            }
            try{
                return new IMHandle(
                    new URL(protocol)
                    , address);
            } catch(MalformedURLException e){
            }
        }
View Full Code Here

    public IMHandle decode(JsonReader reader, IMHandle defaultValue) {
        String address = reader.readProperty("address");
        String protocol = reader.readProperty("protocol");
        if(address != null && protocol != null){
            try{
                return new IMHandle(
                    Scheme.valueOf(protocol)
                    , address);
            } catch(IllegalArgumentException e){
            }
            try{
                return new IMHandle(
                    new URL(protocol)
                    , address);
            } catch(MalformedURLException e){
            }
        }
View Full Code Here

TOP

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

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.