Example usage for java.lang Long getClass

List of usage examples for java.lang Long getClass

Introduction

In this page you can find the example usage for java.lang Long getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.glaf.activiti.executionlistener.SqlDeleteExecutionListener.java

public static void main(String[] args) {
    Long lx = 5L;
    System.out.println(lx.getClass().getSimpleName());
}

From source file:TestJSONStringBuffer.java

public void testObjectInObject() {
    try {/*  w ww. j a va 2 s. com*/
        JSONStringBuffer buf = new JSONStringBuffer();
        buf.append(objectInObject[0]);
        assertEquals(false, buf.stringsAvailable());
        buf.append(objectInObject[1]);
        assertEquals(false, buf.stringsAvailable());
        buf.append(objectInObject[2]);
        assertEquals(true, buf.stringsAvailable());
        ArrayList<String> strings = buf.retrieveAvailableStrings();
        assertEquals(1, strings.size());
        Object o = new Decoder().decode(strings.get(0));
        assertNotNull(o);
        assertEquals(JSONObject.class, o.getClass());
        JSONObject obj1 = (JSONObject) ((JSONObject) o).get("obj1");
        assertEquals(JSONObject.class, obj1.getClass());
        JSONObject obj2 = (JSONObject) obj1.get("obj2");
        assertEquals(JSONObject.class, obj2.getClass());
        Long obj3 = (Long) obj2.get("obj3");
        assertEquals(Long.class, obj3.getClass());
        assertEquals(new Long(42), obj3);
    } catch (Exception e) {
        System.err.println(e);
        fail();
    }
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationPropertiesWithLongArray() {
    ConfigurationPropertiesWithArray config = prepareConfigurationPropertiesWithArray();

    Long longValue = config.longArray[0];

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationXMLWithLongArray() {
    ConfigurationXMLWithArray config = prepareConfigurationXMLWithArray();

    Long longValue = config.longArray[0];

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationPropertiesWithLongList() {
    ConfigurationPropertiesWithList config = prepareConfigurationPropertiesWithList();

    Long longValue = config.longList.get(0);

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longList.size());
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationXMLWithLongList() {
    ConfigurationXMLWithList config = prepareConfigurationXMLWithList();

    Long longValue = config.longList.get(0);

    assertEquals(Long.class, longValue.getClass());
    assertEquals(Long.MAX_VALUE, longValue.longValue());
    assertEquals(5, config.longList.size());
}

From source file:fr.cls.atoll.motu.processor.wps.StringList.java

public static void testBuildWPS() {
    //String serverURL = "http://atoll-dev.cls.fr:30080/atoll-motuservlet/services";
    String serverURL = "http://atoll-dev.cls.fr:30080/atoll-motuservlet/services";

    try {//ww w . jav  a 2 s .c  o  m
        // ServiceMetadata serviceMetadata = new ServiceMetadata();
        // URL url = null;
        // Set<SVOperationMetadataType> listOperation = new HashSet<SVOperationMetadataType>();
        // // url = new
        // //
        // URL("file:///c:/Documents and Settings/dearith/Mes documents/Atoll/SchemaIso/TestServiceMetadataOK.xml");
        // url =
        // Organizer.findResource("src/main/resources/fmpp/out/serviceMetadata_motu-opendap-mercator.xml");
        // serviceMetadata.getOperations(url, listOperation);

        Map<String, ParameterValue<?>> dataInputValues = new HashMap<String, ParameterValue<?>>();

        List<String> list = new ArrayList<String>();
        list.add("a");
        list.add("b");
        list.add("c");

        ParameterDescriptor<String> descriptor = new DefaultParameterDescriptor<String>("service", String.class,
                null, null);
        ParameterValue<?> parameter = new Parameter<String>(descriptor);
        parameter.setValue("myservice");

        System.out.println(descriptor.getName().getCode());

        dataInputValues.put(descriptor.getName().getCode(), parameter);

        ParameterDescriptor<List<String>> descriptor2 = new DefaultParameterDescriptor<List<String>>("variable",
                (Class<List<String>>) list.getClass(), null, null);
        parameter = new Parameter<List<String>>(descriptor2);
        parameter.setValue(list);

        System.out.println(descriptor2.getName().getCode());

        dataInputValues.put(descriptor2.getName().getCode(), parameter);

        // Map geobbox = new HashMap<String, String>();
        // String geobbox ="-10, -60, 45, 120";
        double[] geobbox = new double[] { -10d, -60d, 45d, 120d };
        System.out.println(geobbox.getClass());

        ParameterValue<?> parameterValue = WPSFactory.createParameter("geobbox", geobbox.getClass(), geobbox);
        System.out.println(parameterValue.getValue().getClass());

        dataInputValues.put(parameterValue.getDescriptor().getName().getCode(), parameterValue);

        double depth = 0d;
        parameterValue = WPSFactory.createParameter("lowdepth", depth);
        System.out.println(parameterValue.getValue().getClass());

        dataInputValues.put(parameterValue.getDescriptor().getName().getCode(), parameterValue);

        OperationMetadata operationMetadata = new OperationMetadata();
        operationMetadata.setInvocationName("ExtractData");
        operationMetadata.setParameterValueMap(dataInputValues);

        WPSFactory wpsFactory = new WPSFactory();

        Execute execute = WPSFactory.createExecuteProcessRequest(operationMetadata, null, false);

        FileWriter writer = new FileWriter("WPSExecute.xml");

        WPSInfo wpInfo = WPSFactory.getWpsInfo(serverURL);

        String schemaLocationKey = String.format("%s%s", wpInfo.getProcessDescriptions().getService(),
                wpInfo.getProcessDescriptions().getVersion());
        WPSFactory.marshallExecute(execute, writer, WPSFactory.getSchemaLocations().get(schemaLocationKey));

        dataInputValues.clear();

        Long val = 1023654l;
        // Integer val = 1023654;
        // Double val = 1023654d;
        // String val = "1023654";
        System.out.println(val.getClass());

        parameterValue = WPSFactory.createParameter("requestid", val.getClass(), val);
        System.out.println(parameterValue.getValue().getClass());

        dataInputValues.put(parameterValue.getDescriptor().getName().getCode(), parameterValue);

        operationMetadata.setInvocationName("CompressExtraction");
        operationMetadata.setParameterValueMap(dataInputValues);

        execute = wpsFactory.createExecuteProcessRequest(operationMetadata, null, false);

        writer = new FileWriter("WPSExecute2.xml");

        WPSFactory.marshallExecute(execute, writer, WPSFactory.getSchemaLocations().get(schemaLocationKey));

    } catch (MotuException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        System.out.println(e.notifyException());
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MotuMarshallException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

From source file:org.pentaho.platform.repository.runtime.RuntimeElement.java

/**
 * Sets a long property in the paramMap. If null comes in, it removes the value from the map. Special
 * implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this
 * implementation will remove the entry from the map.
 * //from  w ww . j  a v a 2 s.co m
 * @param key
 *          Key in the paramMap
 * @param value
 *          The property value to set.
 */
public void setLongProperty(final String key, final Long value) {
    this.updateOk();
    trace(Messages.getInstance().getString("RTREPO.DEBUG_PROPERTY_GETSET", "setLong", key)); //$NON-NLS-1$ //$NON-NLS-2$
    checkType(key, value.getClass().getName(), true);
    Map theMap = getParamMapLong();
    if (value != null) {
        theMap.put(key, value);
    } else {
        theMap.remove(key);
    }
}

From source file:org.pentaho.platform.engine.services.runtime.SimpleRuntimeElement.java

/**
 * Sets a long property in the paramMap. If null comes in, it removes the value from the map. Special
 * implementation note - Null values aren't supported in the Map. So, if a null value is passed in, this
 * implementation will remove the entry from the map.
 * /*w  w  w  .  j  a  v a 2 s. c  om*/
 * @param key
 *          Key in the paramMap
 * @param value
 *          The property value to set.
 */
public void setLongProperty(final String key, final Long value) {
    this.updateOk();
    trace(Messages.getInstance().getString("RTREPO.DEBUG_PROPERTY_GETSET", "setLong", key)); //$NON-NLS-1$ //$NON-NLS-2$
    Map theMap = getParamMapLong();
    if (value != null) {
        checkType(key, value.getClass().getName(), true);
        theMap.put(key, value);
    } else {
        theMap.remove(key);
    }
}