Package org.syncany.plugins.transfer
Class TransferManagerFactory.TransferManagerBuilder
- java.lang.Object
-
- org.syncany.plugins.transfer.TransferManagerFactory.TransferManagerBuilder
-
- Enclosing class:
- TransferManagerFactory
public static class TransferManagerFactory.TransferManagerBuilder extends java.lang.Object
The transfer manager builder takes an originalTransferManager
, and wraps it with feature-specific transfer managers, if the original transfer manager is annotated with aFeature
annotation.The class uses the builder pattern. Its usage is described in the
TransferManagerFactory
. The two main methods of this class arewithFeature(Class)
andas(Class)
.- See Also:
Feature
,TransferManagerFactory
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends TransferManager>
Tas(java.lang.Class<? extends java.lang.annotation.Annotation> featureAnnotation)
Wraps of the previously requested feature transfer managers and casts the result to the requested class.TransferManager
asDefault()
Wraps of the previously requested feature transfer managers and returns a standard transfer manager.TransferManagerFactory.TransferManagerBuilder
withFeature(java.lang.Class<? extends java.lang.annotation.Annotation> featureAnnotation)
This method requests the original transfer manager to be wrapped in the corresponding feature transfer manager.
-
-
-
Method Detail
-
withFeature
public TransferManagerFactory.TransferManagerBuilder withFeature(java.lang.Class<? extends java.lang.annotation.Annotation> featureAnnotation)
This method requests the original transfer manager to be wrapped in the corresponding feature transfer manager.Note: Calling this method does not automatically wrap the transfer manager. It will only be wrapped if the original transfer manager is annotated with the feature annotation.
If the requested
Feature
is required (as per its definition), but the original transfer manager is not annotated with this feature, the creation of the transfer manager will fail.- Parameters:
featureAnnotation
- Annotation representing the feature (see features.* package)- Returns:
- Returns this builder class (for more features to be requested)
-
as
public <T extends TransferManager> T as(java.lang.Class<? extends java.lang.annotation.Annotation> featureAnnotation)
Wraps of the previously requested feature transfer managers and casts the result to the requested class. If no specific class is requested,asDefault()
can be used instead.- Parameters:
featureAnnotation
- Feature annotation corresponding to the requested transfer manager- Returns:
TransferManager
casted to the feature lasted wrapped (and requested by this method)
-
asDefault
public TransferManager asDefault()
Wraps of the previously requested feature transfer managers and returns a standard transfer manager.- Returns:
TransferManager
wrapped with the requested features
-
-