@Test public void testCreateName() throws CoreException { MetadataFileNameCreator fnc = new MetadataFileNameCreator("key"); assertEquals("value", fnc.createName(msg)); }
@Override public String createName(AdaptrisMessage msg) throws CoreException { if (getMetadataKey() == null) { throw new CoreException("illegal metadata key [" + metadataKey + "]"); } return StringUtils.defaultIfEmpty(msg.getMetadataValue(metadataKey), defaultName); }
MetadataFileNameCreator implements FileNameCreator { @Override public String createName(AdaptrisMessage msg) throws CoreException { if (getMetadataKey() == null) { throw new CoreException("illegal metadata key [" + metadataKey + "]"); } return StringUtils.defaultIfEmpty(msg.getMetadataValue(metadataKey), defaultName); } }
MetadataFileNameCreator implements FileNameCreator { @Override public String createName(AdaptrisMessage msg) throws CoreException { if (getMetadataKey() == null) { throw new CoreException("illegal metadata key [" + metadataKey + "]"); } return StringUtils.defaultIfEmpty(msg.getMetadataValue(metadataKey), defaultName); } MetadataFileNameCreator();  MetadataFileNameCreator(String metadataKey);  MetadataFileNameCreator(String metadataKey, String defaultName); }
MetadataFileNameCreator implements FileNameCreator { @Override public String createName(AdaptrisMessage msg) throws CoreException { if (getMetadataKey() == null) { throw new CoreException("illegal metadata key [" + metadataKey + "]"); } return StringUtils.defaultIfEmpty(msg.getMetadataValue(metadataKey), defaultName); } MetadataFileNameCreator();  MetadataFileNameCreator(String metadataKey);  MetadataFileNameCreator(String metadataKey, String defaultName); @Override String createName(AdaptrisMessage msg); String getMetadataKey(); void setMetadataKey(String s); String getDefaultName(); void setDefaultName(String s); }
MetadataFileNameCreator implements FileNameCreator { @Override public String createName(AdaptrisMessage msg) throws CoreException { if (getMetadataKey() == null) { throw new CoreException("illegal metadata key [" + metadataKey + "]"); } return StringUtils.defaultIfEmpty(msg.getMetadataValue(metadataKey), defaultName); } MetadataFileNameCreator();  MetadataFileNameCreator(String metadataKey);  MetadataFileNameCreator(String metadataKey, String defaultName); @Override String createName(AdaptrisMessage msg); String getMetadataKey(); void setMetadataKey(String s); String getDefaultName(); void setDefaultName(String s);  }