1
0
mirror of https://github.com/google/nomulus synced 2026-01-09 07:33:42 +00:00

Run automatic Java 8 conversion over codebase

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171174380
This commit is contained in:
mcilwain
2017-10-05 10:48:38 -07:00
committed by Ben McIlwain
parent 44df5da771
commit 5edb7935ed
190 changed files with 2312 additions and 3096 deletions

View File

@@ -16,10 +16,8 @@ package google.registry.model;
import static com.google.common.base.Predicates.or;
import static com.google.common.base.Predicates.subtypeOf;
import static java.util.stream.Collectors.joining;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Ordering;
import java.util.ArrayDeque;
import java.util.Queue;
@@ -60,14 +58,11 @@ public final class SchemaVersion {
* types (for classes), or else a list of all possible values (for enums).
*/
public static String getSchema() {
return FluentIterable.from(getAllPersistedTypes())
return getAllPersistedTypes()
.stream()
.filter(or(subtypeOf(Enum.class), subtypeOf(ImmutableObject.class)))
.transform(new Function<Class<?>, String>() {
@Override
public String apply(Class<?> clazz) {
return ModelUtils.getSchema(clazz);
}})
.join(Joiner.on('\n'));
.map(ModelUtils::getSchema)
.collect(joining("\n"));
}
private SchemaVersion() {}