List of usage examples for java.lang Long toString
public String toString()
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccMssCF.CFAccMssCFBindAccountRollupAccountId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFAccMssCFBindAccountRollupAccountId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }/*from w w w . jav a 2 s . com*/ ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFAccAccountObj) { Long rollupAccountId = ((ICFAccAccountObj) genDef).getOptionalRollupAccountId(); if (rollupAccountId == null) { ret = null; } else { ret = rollupAccountId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFAccAccountObj"); } return (ret); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindRelationColDefSchemaTenantId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFBamMssCFBindRelationColDefSchemaTenantId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }/*from ww w . j av a2s.co m*/ ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFBamRelationColObj) { Long defSchemaTenantId = ((ICFBamRelationColObj) genDef).getOptionalDefSchemaTenantId(); if (defSchemaTenantId == null) { ret = null; } else { ret = defSchemaTenantId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFBamRelationColObj"); } return (ret); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindTableLookupIndexTenantId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFBamMssCFBindTableLookupIndexTenantId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }//from www . j a v a 2s .c om ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFBamTableObj) { Long lookupIndexTenantId = ((ICFBamTableObj) genDef).getOptionalLookupIndexTenantId(); if (lookupIndexTenantId == null) { ret = null; } else { ret = lookupIndexTenantId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFBamTableObj"); } return (ret); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindServerMethodDefSchemaTenantId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFBamMssCFBindServerMethodDefSchemaTenantId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }/*from ww w . j ava 2 s . com*/ ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFBamServerMethodObj) { Long defSchemaTenantId = ((ICFBamServerMethodObj) genDef).getOptionalDefSchemaTenantId(); if (defSchemaTenantId == null) { ret = null; } else { ret = defSchemaTenantId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFBamServerMethodObj"); } return (ret); }
From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashMssCF.CFGCashMssCFBindAccountRollupAccountId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFGCashMssCFBindAccountRollupAccountId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }/*from w ww . ja v a 2 s.com*/ ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFGCashAccountObj) { Long rollupAccountId = ((ICFGCashAccountObj) genDef).getOptionalRollupAccountId(); if (rollupAccountId == null) { ret = null; } else { ret = rollupAccountId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFGCashAccountObj"); } return (ret); }
From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamMssCF.CFBamMssCFBindTablePrimaryIndexTenantId.java
public String expandBody(MssCFGenContext genContext) { final String S_ProcName = "CFBamMssCFBindTablePrimaryIndexTenantId.expandBody() "; if (genContext == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext"); }/*from ww w . j av a 2s. c o m*/ ICFLibAnyObj genDef = genContext.getGenDef(); if (genDef == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()"); } String ret; if (genDef instanceof ICFBamTableObj) { Long primaryIndexTenantId = ((ICFBamTableObj) genDef).getOptionalPrimaryIndexTenantId(); if (primaryIndexTenantId == null) { ret = null; } else { ret = primaryIndexTenantId.toString(); } } else { throw CFLib.getDefaultExceptionFactory().newUnsupportedClassException(getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFBamTableObj"); } return (ret); }
From source file:com.google.code.ssm.test.dao.TestDAOImpl.java
@Override @ReadThroughMultiCache(namespace = CacheConst.BRAVO, expiration = 300) public List<String> getTimestampValues(@ParameterValueKeyProvider final List<Long> keys) { final List<String> results = new ArrayList<String>(); try {/*from w w w. j a v a2 s . c o m*/ Thread.sleep(1500); } catch (InterruptedException ex) { } final Long now = new Date().getTime(); for (final Long key : keys) { results.add(now.toString() + "-X-" + key.toString()); } return results; }
From source file:com.esri.geoevent.solutions.adapter.geomessage.DefenseOutboundAdapter.java
@SuppressWarnings("incomplete-switch") @Override/*from w w w . j a va2 s. c o m*/ public synchronized void receive(GeoEvent geoEvent) { ByteBuffer byteBuffer = ByteBuffer.allocate(10 * 1024); Integer wkid = -1; String message = ""; message += "<geomessage v=\"1.0\">\n\r"; message += "<_type>"; message += messageType; message += "</_type>\n\r"; message += "<_action>"; message += "update"; message += "</_action>\n\r"; String messageid = UUID.randomUUID().toString(); message += "<_id>"; message += "{" + messageid + "}"; message += "</_id>\n\r"; MapGeometry geom = geoEvent.getGeometry(); if (geom.getGeometry().getType() == com.esri.core.geometry.Geometry.Type.Point) { Point p = (Point) geom.getGeometry(); message += "<_control_points>"; message += ((Double) p.getX()).toString(); message += ","; message += ((Double) p.getY()).toString(); message += "</_control_points>\n\r"; wkid = ((Integer) geom.getSpatialReference().getID()); } if (wkid > 0) { String wkidValue = wkid.toString(); message += "<_wkid>"; message += wkidValue.toString(); message += "</_wkid>\n\r"; } GeoEventDefinition definition = geoEvent.getGeoEventDefinition(); for (FieldDefinition fieldDefinition : definition.getFieldDefinitions()) { String attributeName = fieldDefinition.getName(); Object value = geoEvent.getField(attributeName); if (value == null || value.equals("null")) { continue; } FieldType t = fieldDefinition.getType(); if (t != FieldType.Geometry) { message += "<" + attributeName + ">"; switch (t) { case String: // if(((String)value).isEmpty()) // continue; message += value; break; case Date: Date date = (Date) value; message += (formatter.format(date)); break; case Double: Double doubleValue = (Double) value; message += doubleValue.toString(); break; case Float: Float floatValue = (Float) value; message += floatValue.toString(); break; case Integer: Integer intValue = (Integer) value; message += intValue.toString(); break; case Long: Long longValue = (Long) value; message += longValue.toString(); break; case Short: Short shortValue = (Short) value; message += shortValue.toString(); break; case Boolean: Boolean booleanValue = (Boolean) value; message += booleanValue.toString(); break; } message += "</" + attributeName + ">\n\r"; } else { if (definition.getIndexOf(attributeName) == definition.getIndexOf("GEOMETRY")) { continue; } else { String json = GeometryEngine.geometryToJson(wkid, (Geometry) value); message += "<" + attributeName + ">"; message += json; message += "</" + attributeName + ">\n\r"; } break; } } message += "</geomessage>"; // stringBuffer.append("</geomessages>"); message += "\r\n"; ByteBuffer buf = charset.encode(message); if (buf.position() > 0) buf.flip(); try { byteBuffer.put(buf); } catch (BufferOverflowException ex) { LOG.error( "Csv Outbound Adapter does not have enough room in the buffer to hold the outgoing data. Either the receiving transport object is too slow to process the data, or the data message is too big."); } byteBuffer.flip(); super.receive(byteBuffer, geoEvent.getTrackId(), geoEvent); byteBuffer.clear(); }
From source file:com.joyent.manta.http.ApacheHttpGetResponseEntityContentContinuatorTest.java
private static HttpClient prepareMockedClient(final int responseCode, final String etag, final HttpRange.Response contentRange, final Long contentLength, final HttpEntity entity) throws IOException { final HttpClient client = mock(HttpClient.class); final AtomicBoolean responded = new AtomicBoolean(false); when(client.execute(any(HttpUriRequest.class), any(HttpContext.class))).then(invocation -> { if (!responded.compareAndSet(false, true)) { throw new IllegalStateException("this mocked client only provides a single response"); }/* w ww . j a va 2 s . c om*/ final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, responseCode, "mocked"); if (etag != null) { response.setHeader(ETAG, etag); } if (contentRange != null) { response.setHeader(CONTENT_RANGE, contentRange.render()); } if (contentLength != null) { response.setHeader(CONTENT_LENGTH, contentLength.toString()); } if (entity != null) { response.setEntity(entity); } return response; }); return client; }
From source file:by.zatta.pilight.model.Config.java
public static void parse(JSONObject jloc) { Iterator<?> lit = jloc.keys(); /* Iterate through all locations */ while (lit.hasNext()) { String locationID = (String) lit.next(); String locationName = ""; try {//from w w w.j a v a2 s. c o m JSONObject jdev = jloc.getJSONObject(locationID); if (jdev.has("name")) locationName = jdev.getString("name"); // Log.v(TAG, locationID + " = " +locationName); Iterator<?> dit = jdev.keys(); /* Iterate through all devices of this location */ while (dit.hasNext()) { String dkey = (String) dit.next(); // Log.v("dkey", dkey); if (!dkey.equals("name")) { try { /* Create new device object for this location */ DeviceEntry device = new DeviceEntry(); device.setNameID(dkey); device.setLocationID(locationID); List<SettingEntry> settings = new ArrayList<SettingEntry>(); SettingEntry sentry = new SettingEntry(); sentry.setKey("locationName"); sentry.setValue(locationName); settings.add(sentry); JSONObject jset = jdev.getJSONObject(dkey); Iterator<?> sit = jset.keys(); /* Iterate through all settings of this device */ while (sit.hasNext()) { String skey = (String) sit.next(); if (skey.equals("type")) { device.setType(Integer.valueOf(jset.getString(skey))); } /* OBSOLETE LOOP SINCE PILIGHT 4.0 */ // } else if (skey.equals("settings")) { // // iterate over all specific settings // JSONObject jthi = jset.getJSONObject(skey); // Iterator<?> thit = jthi.keys(); // while (thit.hasNext()) { // String thkey = (String) thit.next(); // sentry = new SettingEntry(); // sentry.setKey("sett_" + thkey); // // JSONArray jvalarr = jthi.optJSONArray(thkey); // String jvalstr = jthi.optString(thkey); // Double jvaldbl = jthi.optDouble(thkey); // Long jvallng = jthi.optLong(thkey); // // if (jvalarr != null) { // for (Short i = 0; i < jvalarr.length(); i++) { // sentry.setKey(thkey); // sentry.setValue(jvalarr.get(i).toString()); // } // } else if (jvalstr != null) { // sentry.setValue(jvalstr.toString()); // } else if (jvaldbl != null) { // Log.e(TAG, skey + "double : " + jvaldbl.toString()); // sentry.setValue(jvaldbl.toString()); // } else if (jvallng != null) { // Log.e(TAG, skey + "long : " + jvallng.toString()); // sentry.setValue(jvallng.toString()); // } // if (sentry != null) settings.add(sentry); // } // } else if (skey.equals("id") || skey.equals("protocol") || skey.equals("order")) { } else { try { sentry = new SettingEntry(); sentry.setKey(skey); JSONArray jvalarr = jset.optJSONArray(skey); String jvalstr = jset.optString(skey); Double jvaldbl = jset.optDouble(skey); Long jvallng = jset.optLong(skey); if (jvalarr != null) { for (Short i = 0; i < jvalarr.length(); i++) { sentry.setKey(skey); sentry.setValue(jvalarr.get(i).toString()); } } else if (jvalstr != null) { sentry.setValue(jvalstr.toString()); } else if (jvaldbl != null) { Log.e(TAG, skey + "double : " + jvaldbl.toString()); sentry.setValue(jvaldbl.toString()); } else if (jvallng != null) { Log.e(TAG, skey + "long : " + jvallng.toString()); sentry.setValue(jvallng.toString()); } if (sentry != null) settings.add(sentry); } catch (JSONException e) { Log.w(TAG, "The received SETTING is of an incorrent format"); } } } device.setSettings(settings); mDevices.add(device); } catch (JSONException e) { Log.w(TAG, "The received DEVICE is of an incorrent format"); } } } } catch (JSONException e) { Log.w(TAG, "The received LOCATION is of an incorrent format"); } } try { print(); } catch (Exception e) { Log.w(TAG, "4) couldnt print"); } }