Package com.niacin.input

Examples of com.niacin.input.IntegerVariable


    for (Method m : klass.getMethods())
      if (m.isAnnotationPresent(Input.class))
      {
        if (m.getParameterTypes()[0] == Integer.class || m.getParameterTypes()[0].getName().equals("int"))
        {
          IntegerVariable iv = IntegerVariable.parse(m);
          variables.add(iv);
        }
      }
    return variables;
  }
View Full Code Here


  public Variable<?> createInstance(Type type)
  {
    Type[] typeParameters = ((ParameterizedType)type).getActualTypeArguments();
      Type idType = typeParameters[0];
      if(idType.equals(Integer.class))
        return new IntegerVariable();
    return null ;
  }
View Full Code Here

  public void test() throws SecurityException, NoSuchMethodException
  {
    Gson gson = new GsonBuilder().registerTypeAdapter(Variable.class, new VariableInstanceCreator()).registerTypeAdapter(Variable.class, new VariableSerialiser()).create();
    Class<?> klass = HCTestTarget.class;
    Method m = klass.getMethod("setInput", new Class<?>[]{Integer.class});
    IntegerVariable v = IntegerVariable.parse(m);

    Variable<?> p = v;
    System.out.println(gson.toJson(p));

    Solution s = new Solution();
View Full Code Here

  public void test() throws SecurityException, NoSuchMethodException
  {
    Gson gson = new GsonBuilder().registerTypeAdapter(Variable.class, new VariableInstanceCreator()).registerTypeAdapter(Variable.class, new VariableSerialiser()).create();
    Class<?> klass = HCTestTarget.class;
    Method m = klass.getMethod("setInput", new Class<?>[]{Integer.class});
    IntegerVariable v = IntegerVariable.parse(m);
   
    Variable<Integer> p = v;
    System.out.println(gson.toJson(p));
   
    Solution s = new Solution();
View Full Code Here

TOP

Related Classes of com.niacin.input.IntegerVariable

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.