Remove 'm' prefix from fields
This commit is contained in:
parent
62acbfcd81
commit
23603278ea
5 changed files with 41 additions and 41 deletions
|
@ -268,7 +268,7 @@ public class AccountSettings {
|
|||
* </p>
|
||||
*/
|
||||
private static class IntegerResourceSetting extends PseudoEnumSetting<Integer> {
|
||||
private final Map<Integer, String> mMapping;
|
||||
private final Map<Integer, String> mapping;
|
||||
|
||||
IntegerResourceSetting(int defaultValue, int resId) {
|
||||
super(defaultValue);
|
||||
|
@ -279,12 +279,12 @@ public class AccountSettings {
|
|||
int intValue = Integer.parseInt(value);
|
||||
mapping.put(intValue, value);
|
||||
}
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<Integer, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -305,7 +305,7 @@ public class AccountSettings {
|
|||
* </p>
|
||||
*/
|
||||
private static class StringResourceSetting extends PseudoEnumSetting<String> {
|
||||
private final Map<String, String> mMapping;
|
||||
private final Map<String, String> mapping;
|
||||
|
||||
StringResourceSetting(String defaultValue, int resId) {
|
||||
super(defaultValue);
|
||||
|
@ -315,17 +315,17 @@ public class AccountSettings {
|
|||
for (String value : values) {
|
||||
mapping.put(value, value);
|
||||
}
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fromString(String value) throws InvalidSettingValueException {
|
||||
if (!mMapping.containsKey(value)) {
|
||||
if (!mapping.containsKey(value)) {
|
||||
throw new InvalidSettingValueException();
|
||||
}
|
||||
return value;
|
||||
|
@ -372,7 +372,7 @@ public class AccountSettings {
|
|||
}
|
||||
|
||||
private static class DeletePolicySetting extends PseudoEnumSetting<Integer> {
|
||||
private Map<Integer, String> mMapping;
|
||||
private Map<Integer, String> mapping;
|
||||
|
||||
DeletePolicySetting(DeletePolicy defaultValue) {
|
||||
super(defaultValue.setting);
|
||||
|
@ -380,19 +380,19 @@ public class AccountSettings {
|
|||
mapping.put(DeletePolicy.NEVER.setting, "NEVER");
|
||||
mapping.put(DeletePolicy.ON_DELETE.setting, "DELETE");
|
||||
mapping.put(DeletePolicy.MARK_AS_READ.setting, "MARK_AS_READ");
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<Integer, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer fromString(String value) throws InvalidSettingValueException {
|
||||
try {
|
||||
Integer deletePolicy = Integer.parseInt(value);
|
||||
if (mMapping.containsKey(deletePolicy)) {
|
||||
if (mapping.containsKey(deletePolicy)) {
|
||||
return deletePolicy;
|
||||
}
|
||||
} catch (NumberFormatException e) { /* do nothing */ }
|
||||
|
|
|
@ -414,7 +414,7 @@ public class GlobalSettings {
|
|||
* </p>
|
||||
*/
|
||||
private static class LanguageSetting extends PseudoEnumSetting<String> {
|
||||
private final Map<String, String> mMapping;
|
||||
private final Map<String, String> mapping;
|
||||
|
||||
LanguageSetting() {
|
||||
super("");
|
||||
|
@ -428,17 +428,17 @@ public class GlobalSettings {
|
|||
mapping.put(value, value);
|
||||
}
|
||||
}
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fromString(String value) throws InvalidSettingValueException {
|
||||
if (mMapping.containsKey(value)) {
|
||||
if (mapping.containsKey(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,16 +94,16 @@ class IdentitySettings {
|
|||
* An optional email address setting.
|
||||
*/
|
||||
private static class OptionalEmailAddressSetting extends SettingsDescription<String> {
|
||||
private EmailAddressValidator mValidator;
|
||||
private EmailAddressValidator validator;
|
||||
|
||||
OptionalEmailAddressSetting() {
|
||||
super(null);
|
||||
mValidator = new EmailAddressValidator();
|
||||
validator = new EmailAddressValidator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fromString(String value) throws InvalidSettingValueException {
|
||||
if (value != null && !mValidator.isValidAddressOnly(value)) {
|
||||
if (value != null && !validator.isValidAddressOnly(value)) {
|
||||
throw new InvalidSettingValueException();
|
||||
}
|
||||
return value;
|
||||
|
|
|
@ -283,10 +283,10 @@ public class Settings {
|
|||
/**
|
||||
* The setting's default value (internal representation).
|
||||
*/
|
||||
T mDefaultValue;
|
||||
T defaultValue;
|
||||
|
||||
SettingsDescription(T defaultValue) {
|
||||
mDefaultValue = defaultValue;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -295,7 +295,7 @@ public class Settings {
|
|||
* @return The internal representation of the default value.
|
||||
*/
|
||||
public T getDefaultValue() {
|
||||
return mDefaultValue;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -463,17 +463,17 @@ public class Settings {
|
|||
* </p>
|
||||
*/
|
||||
static class EnumSetting<T extends Enum<T>> extends SettingsDescription<T> {
|
||||
private Class<T> mEnumClass;
|
||||
private Class<T> enumClass;
|
||||
|
||||
EnumSetting(Class<T> enumClass, T defaultValue) {
|
||||
super(defaultValue);
|
||||
mEnumClass = enumClass;
|
||||
this.enumClass = enumClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T fromString(String value) throws InvalidSettingValueException {
|
||||
try {
|
||||
return Enum.valueOf(mEnumClass, value);
|
||||
return Enum.valueOf(enumClass, value);
|
||||
} catch (Exception e) {
|
||||
throw new InvalidSettingValueException();
|
||||
}
|
||||
|
@ -514,7 +514,7 @@ public class Settings {
|
|||
* A font size setting.
|
||||
*/
|
||||
static class FontSizeSetting extends PseudoEnumSetting<Integer> {
|
||||
private final Map<Integer, String> mMapping;
|
||||
private final Map<Integer, String> mapping;
|
||||
|
||||
FontSizeSetting(int defaultValue) {
|
||||
super(defaultValue);
|
||||
|
@ -527,19 +527,19 @@ public class Settings {
|
|||
mapping.put(FontSizes.MEDIUM, "medium");
|
||||
mapping.put(FontSizes.FONT_20SP, "large");
|
||||
mapping.put(FontSizes.LARGE, "larger");
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<Integer, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer fromString(String value) throws InvalidSettingValueException {
|
||||
try {
|
||||
Integer fontSize = Integer.parseInt(value);
|
||||
if (mMapping.containsKey(fontSize)) {
|
||||
if (mapping.containsKey(fontSize)) {
|
||||
return fontSize;
|
||||
}
|
||||
} catch (NumberFormatException e) { /* do nothing */ }
|
||||
|
@ -552,7 +552,7 @@ public class Settings {
|
|||
* A {@link android.webkit.WebView} font size setting.
|
||||
*/
|
||||
static class WebFontSizeSetting extends PseudoEnumSetting<Integer> {
|
||||
private final Map<Integer, String> mMapping;
|
||||
private final Map<Integer, String> mapping;
|
||||
|
||||
WebFontSizeSetting(int defaultValue) {
|
||||
super(defaultValue);
|
||||
|
@ -563,19 +563,19 @@ public class Settings {
|
|||
mapping.put(3, "normal");
|
||||
mapping.put(4, "larger");
|
||||
mapping.put(5, "largest");
|
||||
mMapping = Collections.unmodifiableMap(mapping);
|
||||
this.mapping = Collections.unmodifiableMap(mapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<Integer, String> getMapping() {
|
||||
return mMapping;
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer fromString(String value) throws InvalidSettingValueException {
|
||||
try {
|
||||
Integer fontSize = Integer.parseInt(value);
|
||||
if (mMapping.containsKey(fontSize)) {
|
||||
if (mapping.containsKey(fontSize)) {
|
||||
return fontSize;
|
||||
}
|
||||
} catch (NumberFormatException e) { /* do nothing */ }
|
||||
|
@ -588,20 +588,20 @@ public class Settings {
|
|||
* An integer settings whose values a limited to a certain range.
|
||||
*/
|
||||
static class IntegerRangeSetting extends SettingsDescription<Integer> {
|
||||
private int mStart;
|
||||
private int mEnd;
|
||||
private int start;
|
||||
private int end;
|
||||
|
||||
IntegerRangeSetting(int start, int end, int defaultValue) {
|
||||
super(defaultValue);
|
||||
mStart = start;
|
||||
mEnd = end;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer fromString(String value) throws InvalidSettingValueException {
|
||||
try {
|
||||
int intValue = Integer.parseInt(value);
|
||||
if (mStart <= intValue && intValue <= mEnd) {
|
||||
if (start <= intValue && intValue <= end) {
|
||||
return intValue;
|
||||
}
|
||||
} catch (NumberFormatException e) { /* do nothing */ }
|
||||
|
|
|
@ -1045,20 +1045,20 @@ public class SettingsImporter {
|
|||
}
|
||||
|
||||
private static class ImportedServerSettings extends ServerSettings {
|
||||
private final ImportedServer mImportedServer;
|
||||
private final ImportedServer importedServer;
|
||||
|
||||
public ImportedServerSettings(ImportedServer server) {
|
||||
super(ServerSettings.Type.valueOf(server.type), server.host, convertPort(server.port),
|
||||
convertConnectionSecurity(server.connectionSecurity),
|
||||
server.authenticationType, server.username, server.password,
|
||||
server.clientCertificateAlias);
|
||||
mImportedServer = server;
|
||||
importedServer = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getExtra() {
|
||||
return (mImportedServer.extras != null) ?
|
||||
Collections.unmodifiableMap(mImportedServer.extras.settings) : null;
|
||||
return (importedServer.extras != null) ?
|
||||
Collections.unmodifiableMap(importedServer.extras.settings) : null;
|
||||
}
|
||||
|
||||
private static int convertPort(String port) {
|
||||
|
|
Loading…
Reference in a new issue