mirror of
https://github.com/Rogiel/httpchannel
synced 2025-12-05 23:22:51 +00:00
Adds service implementation documentation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.rogiel.httpchannel.service;
|
||||
|
||||
import com.rogiel.httpchannel.service.Authenticator.AuthenticatorConfiguration;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class AbstractAuthenticatorConfiguration implements
|
||||
AuthenticatorConfiguration {
|
||||
@Override
|
||||
public boolean is(Class<? extends AuthenticatorConfiguration> type) {
|
||||
return type.isAssignableFrom(this.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends AuthenticatorConfiguration> T as(Class<T> type) {
|
||||
if (!is(type))
|
||||
return null;
|
||||
return type.cast(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.rogiel.httpchannel.service;
|
||||
|
||||
import com.rogiel.httpchannel.service.Downloader.DownloaderConfiguration;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class AbstractDownloaderConfiguration implements DownloaderConfiguration {
|
||||
@Override
|
||||
public boolean is(Class<? extends DownloaderConfiguration> type) {
|
||||
return type.isAssignableFrom(this.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends DownloaderConfiguration> T as(Class<T> type) {
|
||||
if (!is(type))
|
||||
return null;
|
||||
return type.cast(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.rogiel.httpchannel.service;
|
||||
|
||||
import com.rogiel.httpchannel.service.Uploader.UploaderConfiguration;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class AbstractUploaderConfiguration implements UploaderConfiguration {
|
||||
@Override
|
||||
public boolean is(Class<? extends UploaderConfiguration> type) {
|
||||
return type.isAssignableFrom(this.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends UploaderConfiguration> T as(Class<T> type) {
|
||||
if (!is(type))
|
||||
return null;
|
||||
return type.cast(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.rogiel.httpchannel.util;
|
||||
|
||||
/**
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
*/
|
||||
public class Filesizes {
|
||||
public static long kb(long kb) {
|
||||
return kb * 1024;
|
||||
}
|
||||
|
||||
public static long mb(long mb) {
|
||||
return kb(mb) * 1024;
|
||||
}
|
||||
|
||||
public static long gb(long gb) {
|
||||
return mb(gb) * 1024;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user