Extract 'MoreMessages' to a separate file

This commit is contained in:
cketti 2021-04-08 20:40:49 +02:00
parent 3a86cc632e
commit 3336fd3ed3
4 changed files with 28 additions and 28 deletions

View file

@ -1851,32 +1851,6 @@ public class LocalFolder {
static final int CHILD_PART_CONTAINS_DATA = 3;
}
public enum MoreMessages {
UNKNOWN("unknown"),
FALSE("false"),
TRUE("true");
private final String databaseName;
MoreMessages(String databaseName) {
this.databaseName = databaseName;
}
public static MoreMessages fromDatabaseName(String databaseName) {
for (MoreMessages value : MoreMessages.values()) {
if (value.databaseName.equals(databaseName)) {
return value;
}
}
throw new IllegalArgumentException("Unknown value: " + databaseName);
}
public String getDatabaseName() {
return databaseName;
}
}
public static boolean isModeMismatch(Account.FolderMode aMode, FolderClass fMode) {
return aMode == Account.FolderMode.NONE
|| (aMode == Account.FolderMode.FIRST_CLASS &&

View file

@ -47,7 +47,6 @@ import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Multipart;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mailstore.LocalFolder.DataLocation;
import com.fsck.k9.mailstore.LocalFolder.MoreMessages;
import com.fsck.k9.mailstore.LockableDatabase.DbCallback;
import com.fsck.k9.mailstore.LockableDatabase.SchemaDefinition;
import com.fsck.k9.mailstore.LockableDatabase.WrappedException;

View file

@ -0,0 +1,28 @@
package com.fsck.k9.mailstore;
public enum MoreMessages {
UNKNOWN("unknown"),
FALSE("false"),
TRUE("true");
private final String databaseName;
MoreMessages(String databaseName) {
this.databaseName = databaseName;
}
public static MoreMessages fromDatabaseName(String databaseName) {
for (MoreMessages value : MoreMessages.values()) {
if (value.databaseName.equals(databaseName)) {
return value;
}
}
throw new IllegalArgumentException("Unknown value: " + databaseName);
}
public String getDatabaseName() {
return databaseName;
}
}

View file

@ -1,7 +1,6 @@
package com.fsck.k9.mailstore;
import com.fsck.k9.mailstore.LocalFolder.MoreMessages;
import org.junit.Test;
import static org.junit.Assert.assertEquals;