code: protected Object getFieldValueByType(String typeName, Object targetNode, Map<String, Object> map,
                                           boolean isExtracted) throws ODataException {
          Object fieldValue = null;
          LOG.debug("Type is {}", typeName);
          Type type = entityDataModel.getType(typeName);
          if (type == null) {
              throw new ODataUnmarshallingException("OData type not found: " + typeName);
          }
          switch (type.getMetaType()) {
              case ENUM:
              case PRIMITIVE:
                  if (isExtracted) {
                      fieldValue = getAppropriateFieldValue(type.getJavaType(), String.valueOf(targetNode));
                  } else {
                      if (map.get(targetNode) != null) {
                          fieldValue = getAppropriateFieldValue(type.getJavaType(), String.valueOf(map.get(targetNode)));
                      }
                  }
                  break;
  
              case ENTITY:
              case COMPLEX:
                  fieldValue = unmarshallEntityByName(typeName, map, targetNode);
                  break;
  
              default:
                  LOG.warn("Unsupported type {}.", type.getMetaType().name());
                  throw new UnsupportedOperationException("Unsupported type: " + typeName);
          }
          return fieldValue;
      }
docs: Gets the field value for the property type.
  
  @param typeName    the type name
  @param targetNode  the target node
  @param map         the map of field value
  @param isExtracted boolean indicating whether the field is extracted
  @return the field object
  @throws ODataException If unable to get field values