Package com.linkedin.data

Examples of com.linkedin.data.DataMap.entrySet()


      {
          //process array range
          composeArrayRange(data, op, instrCtx);

          // process all fields
          for (Entry<String, Object> entry : op.entrySet())
          {
            String fieldName = entry.getKey();
            Object opMask = entry.getValue();
            Object dataMask = data.get(fieldName);
View Full Code Here


        {
          addMessage(element, "DataMap should have exactly one entry for a union type");
        }
        else
        {
          Map.Entry<String, Object> entry = map.entrySet().iterator().next();
          String key = entry.getKey();
          DataSchema memberSchema = schema.getType(key);
          if (memberSchema == null)
          {
            addMessage(element, "\"%1$s\" is not a member type of union %2$s", key, schema);
View Full Code Here

    protected void recurseMap(DataElement element, MapDataSchema schema, Object object)
    {
      DataMap map = (DataMap) object;
      DataSchema childSchema = schema.getValues();
      MutableDataElement childElement = new MutableDataElement(element);
      for (Map.Entry<String, Object> entry : map.entrySet())
      {
        String key = entry.getKey();
        Object value = entry.getValue();
        childElement.setValueNameSchema(value, key, childSchema);
        validate(childElement, childSchema, value);
View Full Code Here

    }
    else
    {
      DataMap validateMap = (DataMap) validateObject;
      List<ValidatorInfo> validatorInfoList = new ArrayList<ValidatorInfo>(validateMap.size());
      for (Map.Entry<String, Object> entry : validateMap.entrySet())
      {
        Object config = entry.getValue();
        String key = entry.getKey();
        Class<? extends Validator> clazz = locateValidatorClass(key, path, source);
        if (clazz == null)
View Full Code Here

        DataMap unionMap = (DataMap) value;
        if (unionMap.size() != 1)
        {
          throw new IllegalArgumentException(message(path, "union value $1%s has more than one entry", value));
        }
        Map.Entry<String, Object> entry = unionMap.entrySet().iterator().next();
        key = entry.getKey();
        memberValue = entry.getValue();
      }
      DataSchema memberDataSchema = unionDataSchema.getType(key);
      if (memberDataSchema == null)
View Full Code Here

      }
      else
      {
        try
        {
          Map.Entry<String, Object> entry = dataMap.entrySet().iterator().next();
          String key = entry.getKey();
          Object value = entry.getValue();
          GenericRecord record = new GenericData.Record(avroSchema);
          record.put(TYPE, new Utf8(key));
          record.put(VALUE, new Utf8(_codec.mapToBytes((DataMap) value)));
View Full Code Here

        case MAP:
          DataMap map = (DataMap) value;
          DataSchema valueDataSchema = ((MapDataSchema) dereferencedDataSchema).getValues();
          Schema valueAvroSchema = avroSchema.getValueType();
          Map<String, Object> avroMap = new HashMap<String, Object>(map.size());
          for (Map.Entry<String, Object> entry : map.entrySet())
          {
            String key = entry.getKey();
            _path.addLast(key);
            Object entryAvroValue = translate(entry.getValue(), valueDataSchema, valueAvroSchema);
            _path.removeLast();
View Full Code Here

            memberValue = Data.NULL;
          }
          else
          {
            map = (DataMap) value;
            Map.Entry<String, Object> entry = map.entrySet().iterator().next();
            key = entry.getKey();
            memberValue = entry.getValue();
          }
          DataSchema memberDataSchema = unionDataSchema.getType(key);
          Map.Entry<String, Schema> memberAvroEntry = findUnionMember(memberDataSchema, avroSchema);
View Full Code Here

                                      "%1$s expects data to be a DataMap with one entry, data is %2$s",
                                      AnyRecordValidator.class.getName(), value));
      }
      else
      {
        Map.Entry<String, Object> entry = dataMap.entrySet().iterator().next();
        String anySchemaName = entry.getKey();
        Object anyValue = entry.getValue();
        DataSchema anySchema = schemaFromName(context, anySchemaName);
        if (anySchema != null)
        {
View Full Code Here

      schema = DataSchemaConstants.NULL_DATA_SCHEMA;
    }
    else
    {
      DataMap dataMap = (DataMap) value;
      Map.Entry<String, ?> mapEntry = dataMap.entrySet().iterator().next();
      schema = unionDataSchema.getTypeByName(mapEntry.getKey());
      assert(schema != null);
    }
    return schema;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.