@Test public void testSetValueNoMetadataKey() throws Exception { String newValue = "NewValue"; metadataValueTranslator.setType("java.lang.String"); metadataValueTranslator.setValue(message, newValue); }
@Override public void setValue(AdaptrisMessage message, Object value) { if(!StringUtils.isEmpty(metadataKey)) { if(this.getType().equals(Date.class.getName())) message.addMetadata(this.getMetadataKey(), Long.toString(((Date)value).getTime())); else message.addMetadata(this.getMetadataKey(), value.toString()); } else log.warn("No metadata key set for metadata-value-translator, no translation occuring."); }
MetadataValueTranslator extends ValueTranslatorImp { @Override public void setValue(AdaptrisMessage message, Object value) { if(!StringUtils.isEmpty(metadataKey)) { if(this.getType().equals(Date.class.getName())) message.addMetadata(this.getMetadataKey(), Long.toString(((Date)value).getTime())); else message.addMetadata(this.getMetadataKey(), value.toString()); } else log.warn("No metadata key set for metadata-value-translator, no translation occuring."); } }
MetadataValueTranslator extends ValueTranslatorImp { @Override public void setValue(AdaptrisMessage message, Object value) { if(!StringUtils.isEmpty(metadataKey)) { if(this.getType().equals(Date.class.getName())) message.addMetadata(this.getMetadataKey(), Long.toString(((Date)value).getTime())); else message.addMetadata(this.getMetadataKey(), value.toString()); } else log.warn("No metadata key set for metadata-value-translator, no translation occuring."); } MetadataValueTranslator();  MetadataValueTranslator(String key, String type); }
MetadataValueTranslator extends ValueTranslatorImp { @Override public void setValue(AdaptrisMessage message, Object value) { if(!StringUtils.isEmpty(metadataKey)) { if(this.getType().equals(Date.class.getName())) message.addMetadata(this.getMetadataKey(), Long.toString(((Date)value).getTime())); else message.addMetadata(this.getMetadataKey(), value.toString()); } else log.warn("No metadata key set for metadata-value-translator, no translation occuring."); } MetadataValueTranslator();  MetadataValueTranslator(String key, String type); @Override Object getValue(AdaptrisMessage message); @Override void setValue(AdaptrisMessage message, Object value); String getMetadataKey(); void setMetadataKey(String metadataKey); }
MetadataValueTranslator extends ValueTranslatorImp { @Override public void setValue(AdaptrisMessage message, Object value) { if(!StringUtils.isEmpty(metadataKey)) { if(this.getType().equals(Date.class.getName())) message.addMetadata(this.getMetadataKey(), Long.toString(((Date)value).getTime())); else message.addMetadata(this.getMetadataKey(), value.toString()); } else log.warn("No metadata key set for metadata-value-translator, no translation occuring."); } MetadataValueTranslator();  MetadataValueTranslator(String key, String type); @Override Object getValue(AdaptrisMessage message); @Override void setValue(AdaptrisMessage message, Object value); String getMetadataKey(); void setMetadataKey(String metadataKey);  }