mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 16:37:13 +02: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:
parent
44df5da771
commit
5edb7935ed
190 changed files with 2312 additions and 3096 deletions
|
@ -17,7 +17,6 @@ package google.registry.model.contact;
|
|||
import static com.google.common.base.Preconditions.checkState;
|
||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Maps;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.contact.PostalInfo.Type;
|
||||
|
@ -67,11 +66,7 @@ public class ContactCommand {
|
|||
// There can be no more than 2 postalInfos (enforced by the schema), and if there are 2 they
|
||||
// must be of different types (not enforced). If the type is repeated, uniqueIndex will throw.
|
||||
checkState(nullToEmpty(postalInfo).size() <= 2);
|
||||
return Maps.uniqueIndex(nullToEmpty(postalInfo), new Function<PostalInfo, Type>() {
|
||||
@Override
|
||||
public Type apply(PostalInfo info) {
|
||||
return info.getType();
|
||||
}});
|
||||
return Maps.uniqueIndex(nullToEmpty(postalInfo), PostalInfo::getType);
|
||||
}
|
||||
|
||||
public ContactPhoneNumber getVoice() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue