Example #1
0
  public static Entity GetEntity(String slideKey, String questionText, int rating) {

    Entity questionEntity = new Entity("Question", KeyFactory.stringToKey(slideKey));
    questionEntity.setProperty("Text", questionText);
    questionEntity.setProperty("Rating", rating);
    questionEntity.setProperty("DatePosted", new Date());

    return questionEntity;
  }
Example #2
0
  public String toString() {
    StringBuilder b = new StringBuilder();
    Key k = KeyFactory.stringToKey(key);
    b.append("Question (").append(k.getId()).append(") : ").append(" Text=").append(questionText);
    b.append(" Date Posted=").append(datePosted);
    b.append(" ParentInfo = ").append(k.getParent().toString());
    b.append("\n");

    for (Comment c : comments) {
      b.append("\t\t").append(c.toString()).append("\n");
    }

    return b.toString();
  }