Package com.linkedin.data

Examples of com.linkedin.data.DataList


    // missing custom Java class attributes, not needed for testing
    public static final ArrayDataSchema SCHEMA = (ArrayDataSchema) DataTemplateUtil.parseSchema("{ \"type\" : \"array\", \"items\" : \"string\" }");

    public CustomPointArray()
    {
      this(new DataList());
    }
View Full Code Here


    {
      this(new DataList());
    }
    public CustomPointArray(int capacity)
    {
      this(new DataList(capacity));
    }
View Full Code Here

    {
      this(new DataList(capacity));
    }
    public CustomPointArray(Collection<CustomPoint> c)
    {
      this(new DataList(c.size()));
      addAll(c);
    }
View Full Code Here

  public PartialRestResponse buildResponse(RoutingResult routingResult, AugmentedRestLiResponseData responseData)
  {
    PartialRestResponse.Builder builder = new PartialRestResponse.Builder();
    CollectionResponse<AnyRecord> collectionResponse = new CollectionResponse<AnyRecord>(AnyRecord.class);
    collectionResponse.setPaging(responseData.getCollectionResponsePaging());
    DataList elementsMap = (DataList) collectionResponse.data().get(CollectionResponse.ELEMENTS);
    for (RecordTemplate entry : responseData.getCollectionResponse())
    {
      CheckedUtil.addWithoutChecking(elementsMap, entry.data());
    }
    if (responseData.getCollectionResponseCustomMetadata() != null)
View Full Code Here

                                           final Parameter<?> param)
  {
    final Object convertedValue;
    if (DataTemplate.class.isAssignableFrom(param.getItemType()))
    {
      final DataList itemsList = (DataList) context.getStructuredParameter(param.getName());
      convertedValue = Array.newInstance(param.getItemType(), itemsList.size());
      int j = 0;
      for (Object paramData: itemsList)
      {
        final DataTemplate<?> itemsElem = DataTemplateUtil.wrap(paramData, param.getItemType().asSubclass(DataTemplate.class));
View Full Code Here

       * ResourceContext is not a DataList we will have to wrap the paramValue inside a DataList
       */
      if (AbstractArrayTemplate.class.isAssignableFrom(paramType) &&
          paramValue.getClass() != DataList.class)
      {
        paramRecordTemplate = DataTemplateUtil.wrap(new DataList(Arrays.asList(paramValue)), paramType);
      }
      else
      {
        paramRecordTemplate = DataTemplateUtil.wrap(paramValue, paramType);
      }
View Full Code Here

            map.put((String) element.getName(), fixed);
          }
        }
        else if (parent.getClass() == DataList.class)
        {
          DataList list = (DataList) parent;
          if (list.isReadOnly())
          {
            _hasFixupReadOnlyError = true;
            addMessage(element, "cannot be fixed because DataList backing an array type is read-only");
          }
          else
          {
            list.set((Integer) element.getName(), fixed);
          }
        }
      }
    }
View Full Code Here

      return fixed;
    }

    protected void recurseArray(DataElement element, ArrayDataSchema schema, Object object)
    {
      DataList list = (DataList) object;
      DataSchema childSchema = schema.getItems();
      int index = 0;
      MutableDataElement childElement = new MutableDataElement(element);
      for (Object value : list)
      {
View Full Code Here

      final String defaultValueString = (String) _defaultValueData;
      try
      {
        if (getType().isArray())
        {
          final DataList valueAsDataList = _codec.stringToList(defaultValueString);
          result = DataTemplateUtil.convertDataListToArray(valueAsDataList, getItemType());
        }
        else if (DataTemplate.class.isAssignableFrom(getType()))
        {
          final Object input;
View Full Code Here

      {
        data = annotationsToData((Annotation[]) memberValue, false);
      }
      else
      {
        final DataList dataList = new DataList();
        final int memberArrayLen = Array.getLength(memberValue);
        for (int i = 0; i < memberArrayLen; ++i)
        {
          dataList.add(annotationMemberToData(Array.get(memberValue, i)));
        }

        if (dataList.isEmpty())
        {
          data = null;
        }
        else
        {
View Full Code Here

TOP

Related Classes of com.linkedin.data.DataList

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.