diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DataPlatformInstanceFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DataPlatformInstanceFieldResolverProvider.java index 153a0d476cffbf..cbb237654e9693 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DataPlatformInstanceFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DataPlatformInstanceFieldResolverProvider.java @@ -28,11 +28,6 @@ public class DataPlatformInstanceFieldResolverProvider implements EntityFieldRes private final EntityClient _entityClient; private final Authentication _systemAuthentication; - @Override - public EntityFieldType getFieldType() { - return EntityFieldType.DATA_PLATFORM_INSTANCE; - } - @Override public List getFieldTypes() { return Collections.singletonList(EntityFieldType.DATA_PLATFORM_INSTANCE); diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DomainFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DomainFieldResolverProvider.java index 66026c13776022..15d821b75c0bdd 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DomainFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/DomainFieldResolverProvider.java @@ -37,11 +37,6 @@ public class DomainFieldResolverProvider implements EntityFieldResolverProvider private final EntityClient _entityClient; private final Authentication _systemAuthentication; - @Override - public EntityFieldType getFieldType() { - return EntityFieldType.DOMAIN; - } - @Override public List getFieldTypes() { return Collections.singletonList(EntityFieldType.DOMAIN); diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityFieldResolverProvider.java index 56e6e47358137a..4e37adf216c7db 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityFieldResolverProvider.java @@ -14,7 +14,9 @@ public interface EntityFieldResolverProvider { /** * Field that this hydrator is hydrating */ - EntityFieldType getFieldType(); + default EntityFieldType getFieldType() { + return this.getFieldTypes().get(0); + } /** * List of fields that this hydrator is hydrating. diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityTypeFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityTypeFieldResolverProvider.java index a3b0ab4ca1c2da..addac84c68b185 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityTypeFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityTypeFieldResolverProvider.java @@ -12,14 +12,10 @@ * Provides field resolver for entity type given entitySpec */ public class EntityTypeFieldResolverProvider implements EntityFieldResolverProvider { - @Override - public EntityFieldType getFieldType() { - return getFieldTypes().get(0); - } @Override public List getFieldTypes() { - return ImmutableList.of(EntityFieldType.RESOURCE_TYPE, EntityFieldType.TYPE); + return ImmutableList.of(EntityFieldType.TYPE, EntityFieldType.RESOURCE_TYPE); } @Override diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityUrnFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityUrnFieldResolverProvider.java index daf207fbc98195..32960de687839a 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityUrnFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/EntityUrnFieldResolverProvider.java @@ -12,14 +12,10 @@ * Provides field resolver for entity urn given entitySpec */ public class EntityUrnFieldResolverProvider implements EntityFieldResolverProvider { - @Override - public EntityFieldType getFieldType() { - return EntityFieldType.URN; - } @Override public List getFieldTypes() { - return ImmutableList.of(EntityFieldType.RESOURCE_URN, EntityFieldType.URN); + return ImmutableList.of(EntityFieldType.URN, EntityFieldType.RESOURCE_URN); } @Override diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/GroupMembershipFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/GroupMembershipFieldResolverProvider.java index d697e93c9068d0..b1202d9f4bbd34 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/GroupMembershipFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/GroupMembershipFieldResolverProvider.java @@ -35,11 +35,6 @@ public class GroupMembershipFieldResolverProvider implements EntityFieldResolver private final EntityClient _entityClient; private final Authentication _systemAuthentication; - @Override - public EntityFieldType getFieldType() { - return EntityFieldType.GROUP_MEMBERSHIP; - } - @Override public List getFieldTypes() { return Collections.singletonList(EntityFieldType.GROUP_MEMBERSHIP); diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/OwnerFieldResolverProvider.java b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/OwnerFieldResolverProvider.java index 1859a8f5a2afa2..3c27f9e6ce8d79 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/OwnerFieldResolverProvider.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/authorization/fieldresolverprovider/OwnerFieldResolverProvider.java @@ -28,11 +28,6 @@ public class OwnerFieldResolverProvider implements EntityFieldResolverProvider { private final EntityClient _entityClient; private final Authentication _systemAuthentication; - @Override - public EntityFieldType getFieldType() { - return EntityFieldType.OWNER; - } - @Override public List getFieldTypes() { return Collections.singletonList(EntityFieldType.OWNER);