Example usage for org.apache.commons.lang3.reflect TypeUtils toString

List of usage examples for org.apache.commons.lang3.reflect TypeUtils toString

Introduction

In this page you can find the example usage for org.apache.commons.lang3.reflect TypeUtils toString.

Prototype

public static String toString(final Type type) 

Source Link

Document

Present a given type as a Java-esque String.

Usage

From source file:org.talend.core.runtime.util.GenericTypeUtils.java

public static boolean isStringType(String type) {
    return TypeUtils.toString(String.class).equals(type)
            || TypeUtils.toString(LIST_STRING_TYPE.getType()).equals(type);
}

From source file:org.talend.core.runtime.util.GenericTypeUtils.java

public static boolean isBooleanType(String type) {
    return TypeUtils.toString(Boolean.class).equals(type)
            || TypeUtils.toString(LIST_BOOLEAN_TYPE.getType()).equals(type);
}

From source file:org.talend.core.runtime.util.GenericTypeUtils.java

public static boolean isSchemaType(Property<?> property) {
    return TypeUtils.toString(Schema.class).equals(property.getType());
}

From source file:org.talend.core.runtime.util.GenericTypeUtils.java

public static boolean isIntegerType(Property<?> property) {
    return TypeUtils.toString(Integer.class).equals(property.getType());
}

From source file:org.talend.core.runtime.util.GenericTypeUtils.java

public static boolean isObjectType(Property<?> property) {
    return TypeUtils.toString(Object.class).equals(property.getType());
}

From source file:org.talend.daikon.properties.property.Property.java

/**
 * For internal use only.//  www  . j  av  a  2s  .c o m
 */
Property(Type type, String name, String title) {
    // we cannot store the type as is because of a serialization issue that will serialised
    // sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl and will fail with jsonio
    // and also is not portable across different jvm vendors.
    this(TypeUtils.toString(type), name, title);
}

From source file:org.talend.daikon.properties.PropertyFactoryTest.java

@Test
public void testNewStringProperty() {
    Property<String> element = PropertyFactory.newProperty("testProperty");
    assertEquals("testProperty", element.getName());
    assertNull(element.getValue());//  w  w  w .  java 2s  .c o  m
    assertNull(element.getTitle());
    assertEquals(TypeUtils.toString(String.class), element.getType());
}

From source file:org.talend.daikon.properties.PropertyFactoryTest.java

@Test
public void testNewProperty_WithTypeAndTitle() {
    Property<Boolean> element = PropertyFactory.newProperty(new TypeLiteral<Boolean>() {// left empty on purpose
    }, "testProperty", "title");
    assertEquals("testProperty", element.getName());
    assertNull(element.getValue());//from  w  ww.  j  a va2  s  .  c  o  m
    assertEquals("title", element.getTitle());
    assertEquals(TypeUtils.toString(Boolean.class), element.getType());
}

From source file:org.talend.daikon.properties.PropertyFactoryTest.java

@Test
public void testNewProperty_WithType() {
    Property<Boolean> element = PropertyFactory.newProperty(new TypeLiteral<Boolean>() {// left empty on purpose
    }, "testProperty");
    assertEquals("testProperty", element.getName());
    assertNull(element.getValue());//from ww w .  ja  v a 2 s  . c  om
    assertNull(element.getTitle());
    assertEquals(TypeUtils.toString(Boolean.class), element.getType());
}

From source file:org.talend.daikon.properties.PropertyFactoryTest.java

@Test
public void testNewString() {
    Property<String> element = PropertyFactory.newString("testProperty");
    assertEquals("testProperty", element.getName());
    assertNull(element.getValue());//from w w  w . java  2  s.com
    assertNull(element.getTitle());
    assertEquals(TypeUtils.toString(String.class), element.getType());
}