Package com.linkedin.data.template

Examples of com.linkedin.data.template.StringArray


  }

  private void appendSupportsNodeToCollectionSchema(final CollectionSchema collectionSchema,
                                                    final ResourceModel resourceModel)
  {
    StringArray supportsArray = buildSupportsNode(resourceModel);
    collectionSchema.setSupports(supportsArray);
  }
View Full Code Here


  }

  private void appendSupportsNodeToSimpleSchema(final SimpleSchema simpleSchema,
                                                      final ResourceModel resourceModel)
  {
    StringArray supportsArray = buildSupportsNode(resourceModel);
    simpleSchema.setSupports(supportsArray);
  }
View Full Code Here

    }
  }

  private StringArray buildSupportsNode(ResourceModel resourceModel)
  {
    StringArray supportsArray = new StringArray();

    buildSupportsArray(resourceModel, supportsArray);
    return supportsArray;
  }
View Full Code Here

    final List<String> stringList = new ArrayList<String>();
    stringList.add("abc");
    stringList.add(null);
    stringList.add("def");
    //Return a StringArray with a null element
    return new StringArray(stringList);
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    Parameter<StringArray> param3 = new Parameter<StringArray>(param3Key, StringArray.class, DataTemplateUtil.getSchema(StringArray.class),
                                      true, null, Parameter.ParamType.QUERY, true, AnnotationSet.EMPTY);

    DataList param3Value = new DataList(Arrays.asList("param3a", "param3b"));
    StringArray param3Final = new StringArray(param3Value);

    //test data template argument array with only one element
    String param4Key = "param4";
    @SuppressWarnings("unchecked")
    Parameter<StringArray> param4 = new Parameter<StringArray>(param4Key, StringArray.class, DataTemplateUtil.getSchema(StringArray.class),
                                          true, null, Parameter.ParamType.QUERY, true, AnnotationSet.EMPTY);
    String param4Value = "param4Value";
    StringArray param4Final = new StringArray(new DataList(Collections.singletonList(param4Value)));

    // test record template
    String param5Key = "param5";
    Parameter<TestRecord> param5 = new Parameter<TestRecord>(param5Key, TestRecord.class, DataTemplateUtil.getSchema(TestRecord.class),
                                                             true, null, Parameter.ParamType.QUERY, true, AnnotationSet.EMPTY);
View Full Code Here

    Map<String, StringArray> input = new HashMap<String, StringArray>();
    for (int i = 0; i < 5; ++i)
    {
      String key = "input" + i;
      input.put(key, new StringArray());
      input.get(key).add("subinput" + i);
    }
    Map<String, StringArray> adds = new HashMap<String, StringArray>();
    for (int i = 0; i < 5; ++i)
    {
      String key = "add" + i;
      adds.put(key, new StringArray());
      adds.get(key).add("subadd" + i);
    }

    TestMapTemplate.testMap(templateClass, schema, input, adds);
  }
View Full Code Here

    }
    else if(resourceSchema.hasActionsSet())
    {
      _type = ResourceType.ACTION_SET;
      ActionsSetSchema actionSet = resourceSchema.getActionsSet();
      _supports = new StringArray(0);
      _methods = new RestMethodSchemaArray(0);
      _finders = new FinderSchemaArray(0);;
      _actions = actionSet.hasActions() ? actionSet.getActions() : new ActionSchemaArray(0);
      _entity = null;
    }
View Full Code Here

    ArrayDataSchema schema = (ArrayDataSchema) fieldInfo.getField().getType();

    List<StringArray> input = new ArrayList<StringArray>();
    for (int i = 0; i < 5; ++i)
    {
      input.add(new StringArray());
      input.get(i).add("input " + i);
    }
    List<StringArray> adds = new ArrayList<StringArray>();
    for (int i = 0; i < 5; ++i)
    {
      adds.add(new StringArray());
      adds.get(i).add("add " + i);
    }

    TestArrayTemplate.testArray(templateClass, schema, input, adds);
  }
View Full Code Here

      },
      {
        "FixedMD5", new FixedMD5(ByteString.copyAvroString("0123456789abcdef", false))
      },
      {
        "array", new StringArray(Arrays.asList("a1", "b2", "c3"))
      },
      {
        "map", new LongMap(TestUtil.dataMapFromString("{ \"k1\" : \"v1\" }"))
      }
    };
View Full Code Here

  @SuppressWarnings({"unchecked", "rawtypes"})
  private ResourceSpec collectionToResourceSpec(ResourceSchema resourceSchema, CollectionSchema collection)
  {
    ActionSchemaArray actions = null, entityActions = null;
    StringArray supports = collection.getSupports();
    if(collection.hasActions())
    {
      actions = collection.getActions();
    }
    if(collection.getEntity().hasActions())
View Full Code Here

TOP

Related Classes of com.linkedin.data.template.StringArray

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.