Ejemplo n.º 1
0
  public List<Object> getValues(PrestoField field) {
    FieldDefinition fieldDefinition =
        FieldDefinition.getFieldDefinition(
            session.getTopicById(field.getId()), session.getTopicMap());

    Collection<? extends Object> fieldValues = fieldDefinition.getValues(topic);
    List<Object> result = new ArrayList<Object>(fieldValues.size());
    if (fieldDefinition.getFieldType() == FieldDefinition.FIELD_TYPE_ROLE
        && ((RoleField) fieldDefinition).getAssociationField().getArity() == 1) {
      result.add(!fieldValues.isEmpty());
    } else {
      for (Object value : fieldValues) {
        result.add(normalizeValue(topic, fieldDefinition, value));
      }
    }
    return result;
  }