@Test public void testActionsForCopy() { assertEquals(2, (TransferAction.forTransfer(Transfer.Type.copy).size())); assertTrue(TransferAction.forTransfer(Transfer.Type.copy).contains(TransferAction.comparison)); assertTrue(TransferAction.forTransfer(Transfer.Type.copy).contains(TransferAction.overwrite)); }
public static List<TransferAction> forTransfer(final Transfer.Type t) { switch(t) { case sync: return Arrays.asList( TransferAction.download, TransferAction.upload, TransferAction.mirror ); case copy: return Arrays.asList( TransferAction.overwrite, TransferAction.comparison ); default: return Arrays.asList( TransferAction.resume, TransferAction.overwrite, TransferAction.rename, TransferAction.renameexisting, TransferAction.skip, TransferAction.comparison ); } }
TransferAction { public static List<TransferAction> forTransfer(final Transfer.Type t) { switch(t) { case sync: return Arrays.asList( TransferAction.download, TransferAction.upload, TransferAction.mirror ); case copy: return Arrays.asList( TransferAction.overwrite, TransferAction.comparison ); default: return Arrays.asList( TransferAction.resume, TransferAction.overwrite, TransferAction.rename, TransferAction.renameexisting, TransferAction.skip, TransferAction.comparison ); } } }
TransferAction { public static List<TransferAction> forTransfer(final Transfer.Type t) { switch(t) { case sync: return Arrays.asList( TransferAction.download, TransferAction.upload, TransferAction.mirror ); case copy: return Arrays.asList( TransferAction.overwrite, TransferAction.comparison ); default: return Arrays.asList( TransferAction.resume, TransferAction.overwrite, TransferAction.rename, TransferAction.renameexisting, TransferAction.skip, TransferAction.comparison ); } } TransferAction(final String name); }
TransferAction { public static List<TransferAction> forTransfer(final Transfer.Type t) { switch(t) { case sync: return Arrays.asList( TransferAction.download, TransferAction.upload, TransferAction.mirror ); case copy: return Arrays.asList( TransferAction.overwrite, TransferAction.comparison ); default: return Arrays.asList( TransferAction.resume, TransferAction.overwrite, TransferAction.rename, TransferAction.renameexisting, TransferAction.skip, TransferAction.comparison ); } } TransferAction(final String name); static TransferAction forName(final String name); static List<TransferAction> forTransfer(final Transfer.Type t); abstract String getTitle(); abstract String getDescription(); String name(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); }
TransferAction { public static List<TransferAction> forTransfer(final Transfer.Type t) { switch(t) { case sync: return Arrays.asList( TransferAction.download, TransferAction.upload, TransferAction.mirror ); case copy: return Arrays.asList( TransferAction.overwrite, TransferAction.comparison ); default: return Arrays.asList( TransferAction.resume, TransferAction.overwrite, TransferAction.rename, TransferAction.renameexisting, TransferAction.skip, TransferAction.comparison ); } } TransferAction(final String name); static TransferAction forName(final String name); static List<TransferAction> forTransfer(final Transfer.Type t); abstract String getTitle(); abstract String getDescription(); String name(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); static final TransferAction overwrite; static final TransferAction resume; static final TransferAction rename; static final TransferAction renameexisting; static final TransferAction skip; static final TransferAction trash; static final TransferAction callback; static final TransferAction comparison; static final TransferAction cancel; static final TransferAction download; static final TransferAction upload; static final TransferAction mirror; }