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

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


        throw new NotSupportedException();
    }

    @Override
    public BodyType getBodyType() {
        BodyType type = null;
        if (displayField(Field.BODY_TYPE)) {
            Map<String, String> map = mapValuesByQualifier(getFromProperties(Field.BODY_TYPE));
            type = new BodyTypeImpl();
            type.setBuild(map.get("build"));
            type.setEyeColor(map.get("eyeColor"));
            type.setHairColor(map.get("hairColor"));
            type.setHeight(map.containsKey("height") ? Float.parseFloat(map.get("height")) : null);
            type.setWeight(map.containsKey("weight") ? Float.parseFloat(map.get("weight")) : null);
        }
        return type;
    }
View Full Code Here


    assertEquals(canonical.getAge().intValue(), result.getInt(
        Person.Field.AGE.toString()));

    JSONObject jsonBody = result.getJSONObject(
        Person.Field.BODY_TYPE.toString());
    BodyType body = canonical.getBodyType();
    assertStringField(jsonBody, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(jsonBody, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(jsonBody, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(jsonBody, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(jsonBody, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

    assertEquals(canonical.getAge().intValue(), Integer.parseInt(result.get(
        Person.Field.AGE.toString()).get(0)));

    Map<String, List<String>> bodyMap = childNodesToMap(childNodeMap.get(
        Person.Field.BODY_TYPE.toString()).get(0));
    BodyType body = canonical.getBodyType();

    assertStringField(bodyMap, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(bodyMap, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(bodyMap, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(bodyMap, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(bodyMap, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

    assertEquals(canonical.getAge().intValue(), result.getInt(
        Person.Field.AGE.toString()));

    JSONObject jsonBody = result.getJSONObject(
        Person.Field.BODY_TYPE.toString());
    BodyType body = canonical.getBodyType();
    assertStringField(jsonBody, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(jsonBody, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(jsonBody, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(jsonBody, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(jsonBody, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

    }
    return email;
  }

  private BodyType getNewBodyType(int i) {
    BodyType bodyType = findOne(BodyTypeDb.FINDBY_HEIGHT, new String[] { BodyTypeDb.PARAM_HEIGHT },
        new Object[] { new Float(i % 10) });
    if (bodyType == null) {
      bodyType = new BodyTypeDb();
      bodyType.setBuild("Build " + i);
      bodyType.setEyeColor("Build " + i);
      bodyType.setHairColor("Build " + i);
      bodyType.setHeight(new Float(i % 10));
      bodyType.setWeight(new Float(i % 15));
    }
    return bodyType;
  }
View Full Code Here

    assertEquals(canonical.getAge().intValue(), Integer.parseInt(result.get(
        Person.Field.AGE.toString()).get(0)));

    Map<String, List<String>> bodyMap = childNodesToMap(childNodeMap.get(
        Person.Field.BODY_TYPE.toString()).get(0));
    BodyType body = canonical.getBodyType();

    assertStringField(bodyMap, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(bodyMap, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(bodyMap, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(bodyMap, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(bodyMap, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

    }
    return email;
  }

  private BodyType getNewBodyType(int i) {
    BodyType bodyType = findOne(BodyTypeDb.FINDBY_HEIGHT, new String[] { BodyTypeDb.PARAM_HEIGHT },
        new Object[] { new Float(i % 10) });
    if (bodyType == null) {
      bodyType = new BodyTypeDb();
      bodyType.setBuild("Build " + i);
      bodyType.setEyeColor("Build " + i);
      bodyType.setHairColor("Build " + i);
      bodyType.setHeight(new Float(i % 10));
      bodyType.setWeight(new Float(i % 15));
    }
    return bodyType;
  }
View Full Code Here

    assertEquals(canonical.getAge().intValue(), Integer.parseInt(result.get(
        Person.Field.AGE.toString()).get(0)));

    Map<String, List<String>> bodyMap = childNodesToMap(childNodeMap.get(
        Person.Field.BODY_TYPE.toString()).get(0));
    BodyType body = canonical.getBodyType();

    assertStringField(bodyMap, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(bodyMap, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(bodyMap, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(bodyMap, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(bodyMap, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

    assertEquals(canonical.getAge().intValue(), result.getInt(
        Person.Field.AGE.toString()));

    JSONObject jsonBody = result.getJSONObject(
        Person.Field.BODY_TYPE.toString());
    BodyType body = canonical.getBodyType();
    assertStringField(jsonBody, body.getBuild(), BodyType.Field.BUILD);
    assertStringField(jsonBody, body.getEyeColor(), BodyType.Field.EYE_COLOR);
    assertStringField(jsonBody, body.getHairColor(), BodyType.Field.HAIR_COLOR);
    assertFloatField(jsonBody, body.getHeight(), BodyType.Field.HEIGHT);
    assertFloatField(jsonBody, body.getWeight(), BodyType.Field.WEIGHT);

    assertStringListField(result, canonical.getBooks(), Person.Field.BOOKS);
    assertStringListField(result, canonical.getCars(), Person.Field.CARS);
    assertStringField(result, canonical.getChildren(), Person.Field.CHILDREN);
View Full Code Here

        throw new NotSupportedException();
    }

    @Override
    public BodyType getBodyType() {
        BodyType type = null;
        if (displayField(Field.BODY_TYPE)) {
            Map<String, String> map = mapValuesByQualifier(getFromProperties(Field.BODY_TYPE));
            type = new BodyTypeImpl();
            type.setBuild(map.get("build"));
            type.setEyeColor(map.get("eyeColor"));
            type.setHairColor(map.get("hairColor"));
            type.setHeight(map.containsKey("height") ? Float.parseFloat(map.get("height")) : null);
            type.setWeight(map.containsKey("weight") ? Float.parseFloat(map.get("weight")) : null);
        }
        return type;
    }
View Full Code Here

TOP

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

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.