test_class.file: web-framework/src/test/java/org/unidal/web/jsp/function/ObjectFunctionTest.java
test_class.identifier: ObjectFunctionTest
test_case.body: @Test
     public void testIn() {
        Assert.assertEquals(false, ObjectFunction.in(null, null));
        Assert.assertEquals(false, ObjectFunction.in("abc", "ab"));
        Assert.assertEquals(true, ObjectFunction.in("abc", "abc"));
        Assert.assertEquals(true, ObjectFunction.in(Arrays.asList("a", "abc"), "abc"));
        Assert.assertEquals(true, ObjectFunction.in(new Object[] { "a", "abc" }, "abc"));
        Assert.assertEquals(false, ObjectFunction.in(new Object[] { "a", "abc" }, "abcd"));
  
        Assert.assertEquals(true, ObjectFunction.in(new Object[] { 1, "2", 3 }, "3"));
     }
test_case.class_method_signature: ObjectFunctionTest.testIn()
test_case.full_signature: @Test public void testIn()
test_case.identifier: testIn
test_case.invocations: assertEquals in assertEquals in assertEquals in assertEquals in asList assertEquals in assertEquals in assertEquals in
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIn()
focal_class.file: web-framework/src/main/java/org/unidal/web/jsp/function/ObjectFunction.java
focal_class.identifier: ObjectFunction
focal_class.class_method_signature: ObjectFunction.length(Object obj)
focal_class.full_signature: @FunctionMeta(description = "Length of String, or array", example = "${w:length(obj)}") public static Object length(Object obj)
focal_class.identifier: length
focal_class.modifiers: @FunctionMeta(description = "Length of String, or array", example = "${w:length(obj)}") public static
focal_class.parameters: (Object obj)
focal_class.return: Object
focal_class.signature: Object length(Object obj)
focal_class.class_method_signature: ObjectFunction.size(Object obj)
focal_class.full_signature: @FunctionMeta(description = "size of colection, or map", example = "${w:size(obj)}") public static Object size(Object obj)
focal_class.identifier: size
focal_class.modifiers: @FunctionMeta(description = "size of colection, or map", example = "${w:size(obj)}") public static
focal_class.parameters: (Object obj)
focal_class.return: Object
focal_class.signature: Object size(Object obj)
focal_class.class_method_signature: ObjectFunction.in(Object values, Object value)
focal_class.full_signature: @FunctionMeta(description = "Check if the value is equal or is one of value in the given values.", example = "${w:in(values, value)}") @SuppressWarnings("unchecked") public static boolean in(Object values, Object value)
focal_class.identifier: in
focal_class.modifiers: @FunctionMeta(description = "Check if the value is equal or is one of value in the given values.", example = "${w:in(values, value)}") @SuppressWarnings("unchecked") public static
focal_class.parameters: (Object values, Object value)
focal_class.return: boolean
focal_class.signature: boolean in(Object values, Object value)
focal_method.body: @FunctionMeta(description = "Check if the value is equal or is one of value in the given values.", example = "${w:in(values, value)}")
     @SuppressWarnings("unchecked")
     public static boolean in(Object values, Object value) {
        if (values == null || value == null) {
           return false;
        }
  
        if (values instanceof List) {
           for (Object v : (List<Object>) values) {
              if (v != null && value.toString().equals(v.toString())) {
                 return true;
              }
           }
  
           return false;
        } else if (values.getClass().isArray()) {
           int len = Array.getLength(values);
  
           for (int i = 0; i < len; i++) {
              Object v = Array.get(values, i);
  
              if (v != null && value.toString().equals(v.toString())) {
                 return true;
              }
           }
  
           return false;
        } else {
           return values.toString().equals(value.toString());
        }
     }
focal_method.class_method_signature: ObjectFunction.in(Object values, Object value)
focal_method.full_signature: @FunctionMeta(description = "Check if the value is equal or is one of value in the given values.", example = "${w:in(values, value)}") @SuppressWarnings("unchecked") public static boolean in(Object values, Object value)
focal_method.identifier: in
focal_method.invocations: equals toString toString isArray getClass getLength get equals toString toString equals toString toString
focal_method.modifiers: @FunctionMeta(description = "Check if the value is equal or is one of value in the given values.", example = "${w:in(values, value)}") @SuppressWarnings("unchecked") public static
focal_method.parameters: (Object values, Object value)
focal_method.return: boolean
focal_method.signature: boolean in(Object values, Object value)