Package com.android.repository.api
Class SimpleRepositorySource
- java.lang.Object
-
- com.android.repository.api.SimpleRepositorySource
-
- All Implemented Interfaces:
RepositorySource
public class SimpleRepositorySource extends java.lang.Object implements RepositorySource
A simpleRepositorySource.
-
-
Constructor Summary
Constructors Constructor Description SimpleRepositorySource(java.lang.String url, java.lang.String displayName, boolean enabled, java.util.Collection<SchemaModule<?>> allowedModules, RepositorySourceProvider provider)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisplayName()java.lang.StringgetFetchError()Gets the error (if any) encountered when fetching content from this source.java.util.Collection<SchemaModule<?>>getPermittedModules()Gets theSchemaModules that are allowed to be used to parse XML from this source.RepositorySourceProvidergetProvider()java.lang.StringgetUrl()booleanisEnabled()voidsetEnabled(boolean enabled)voidsetFetchError(java.lang.String error)If an error was encountered loading from this source, it can be set here for display to the user.java.lang.StringtoString()Returns a debug string representation of this object.
-
-
-
Constructor Detail
-
SimpleRepositorySource
public SimpleRepositorySource(@NonNull java.lang.String url, @Nullable java.lang.String displayName, boolean enabled, @NonNull java.util.Collection<SchemaModule<?>> allowedModules, @NonNull RepositorySourceProvider provider)Constructor- Parameters:
url- The URL this source will fetch from.displayName- The user-friendly name for this sourceenabled- Whether this source is enabled.allowedModules- TheSchemaModules allowed to be used when parsing the xml downloaded from this source.provider- TheRepositorySourceProviderthat created this source.
-
-
Method Detail
-
getPermittedModules
@NonNull public java.util.Collection<SchemaModule<?>> getPermittedModules()
Description copied from interface:RepositorySourceGets theSchemaModules that are allowed to be used to parse XML from this source.- Specified by:
getPermittedModulesin interfaceRepositorySource
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceRepositorySource- Returns:
- true if this source is enabled.
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabledin interfaceRepositorySource- Parameters:
enabled- Whether this source should be enabled or disabled.
-
getDisplayName
@Nullable public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein interfaceRepositorySource- Returns:
- The user-friendly name for this source.
-
getUrl
@NonNull public java.lang.String getUrl()
- Specified by:
getUrlin interfaceRepositorySource- Returns:
- The URL from which to download.
-
toString
@NonNull public java.lang.String toString()
Returns a debug string representation of this object. Not for user display.- Overrides:
toStringin classjava.lang.Object
-
setFetchError
public void setFetchError(@Nullable java.lang.String error)Description copied from interface:RepositorySourceIf an error was encountered loading from this source, it can be set here for display to the user.- Specified by:
setFetchErrorin interfaceRepositorySource
-
getFetchError
@Nullable public java.lang.String getFetchError()
Description copied from interface:RepositorySourceGets the error (if any) encountered when fetching content from this source.- Specified by:
getFetchErrorin interfaceRepositorySource- Returns:
- The error, or
nullif the load was successful.
-
getProvider
@NonNull public RepositorySourceProvider getProvider()
- Specified by:
getProviderin interfaceRepositorySource- Returns:
- The provider that created this source.
-
-