Search in sources :

Example 1 with UserImpl

use of org.javacord.core.entity.user.UserImpl in project Javacord by BtoBastian.

the class PrivateChannelImpl method getOrCreatePrivateChannel.

/**
 * This function is used internally by Javacord to get create and update private channels.
 * It checks if the recipient is known and dispatches a private channel create event if the channel got created.
 *
 * @param api The discord api instance.
 * @param channelId The id of the channel to get.
 * @param userId The id of the recipient of the channel or yourself.
 * @param user The user with the user id.
 *
 * @return The private channel with the id.
 */
public static PrivateChannelImpl getOrCreatePrivateChannel(DiscordApiImpl api, long channelId, long userId, UserImpl user) {
    Optional<PrivateChannel> optionalChannel = api.getPrivateChannelById(channelId);
    if (optionalChannel.isPresent()) {
        // if necessary update private channel information
        PrivateChannelImpl channel = (PrivateChannelImpl) optionalChannel.get();
        if (!channel.getRecipientId().isPresent() && userId != api.getYourself().getId()) {
            channel.updateRecipientId(userId);
        }
        if (!channel.getRecipient().isPresent()) {
            UserImpl recipient;
            if (user == null) {
                recipient = (UserImpl) api.getCachedUserById(userId).orElse(null);
            } else {
                recipient = user;
            }
            if (recipient != null && !recipient.isYourself()) {
                channel.updateRecipient(recipient);
            }
        }
        return channel;
    }
    if (userId == api.getYourself().getId()) {
        return dispatchPrivateChannelCreateEvent(api, new PrivateChannelImpl(api, channelId, null, null));
    }
    UserImpl recipient;
    if (user == null) {
        recipient = (UserImpl) api.getCachedUserById(userId).orElse(null);
    } else {
        recipient = user;
    }
    return dispatchPrivateChannelCreateEvent(api, new PrivateChannelImpl(api, channelId, recipient, userId));
}
Also used : PrivateChannel(org.javacord.api.entity.channel.PrivateChannel) UserImpl(org.javacord.core.entity.user.UserImpl)

Example 2 with UserImpl

use of org.javacord.core.entity.user.UserImpl in project Javacord by BtoBastian.

the class InteractionCreateHandler method handle.

@Override
public void handle(JsonNode packet) {
    TextChannel channel = null;
    if (packet.hasNonNull("channel_id")) {
        long channelId = packet.get("channel_id").asLong();
        // Check if this interaction comes from a guild or a DM
        if (packet.hasNonNull("guild_id")) {
            channel = api.getTextChannelById(channelId).orElse(null);
        } else {
            UserImpl user = new UserImpl(api, packet.get("user"), (MemberImpl) null, null);
            channel = PrivateChannelImpl.getOrCreatePrivateChannel(api, channelId, user.getId(), user);
        }
    }
    int typeId = packet.get("type").asInt();
    final InteractionType interactionType = InteractionType.fromValue(typeId);
    ComponentType componentType = null;
    InteractionImpl interaction;
    switch(interactionType) {
        case APPLICATION_COMMAND:
            int applicationCommandTypeId = packet.get("data").get("type").asInt();
            ApplicationCommandType applicationCommandType = ApplicationCommandType.fromValue(applicationCommandTypeId);
            switch(applicationCommandType) {
                case SLASH:
                    interaction = new SlashCommandInteractionImpl(api, channel, packet);
                    break;
                case USER:
                    interaction = new UserContextMenuInteractionImpl(api, channel, packet);
                    break;
                case MESSAGE:
                    interaction = new MessageContextMenuInteractionImpl(api, channel, packet);
                    break;
                default:
                    logger.info("Got application command interaction of unknown type <{}>. " + "Please contact the developer!", applicationCommandTypeId);
                    return;
            }
            break;
        case MESSAGE_COMPONENT:
            int componentTypeId = packet.get("data").get("component_type").asInt();
            componentType = ComponentType.fromId(componentTypeId);
            switch(componentType) {
                case BUTTON:
                    interaction = new ButtonInteractionImpl(api, channel, packet);
                    break;
                case ACTION_ROW:
                    logger.warn("Received a message component interaction of type ACTION_ROW. This should not" + " be possible.");
                    return;
                case SELECT_MENU:
                    interaction = new SelectMenuInteractionImpl(api, channel, packet);
                    break;
                default:
                    logger.warn("Received message component interaction of unknown type <{}>. " + "Please contact the developer!", componentTypeId);
                    return;
            }
            break;
        case APPLICATION_COMMAND_AUTOCOMPLETE:
            interaction = new AutocompleteInteractionImpl(api, channel, packet);
            break;
        default:
            logger.warn("Received interaction of unknown type <{}>. " + "Please contact the developer!", typeId);
            return;
    }
    InteractionCreateEvent event = new InteractionCreateEventImpl(interaction);
    ServerImpl server = (ServerImpl) interaction.getServer().orElse(null);
    api.getEventDispatcher().dispatchInteractionCreateEvent(server == null ? api : server, server, interaction.getChannel().orElse(null), interaction.getUser(), event);
    switch(interactionType) {
        case APPLICATION_COMMAND:
            int applicationCommandTypeId = packet.get("data").get("type").asInt();
            ApplicationCommandType applicationCommandType = ApplicationCommandType.fromValue(applicationCommandTypeId);
            switch(applicationCommandType) {
                case SLASH:
                    SlashCommandCreateEvent slashCommandCreateEvent = new SlashCommandCreateEventImpl(interaction);
                    api.getEventDispatcher().dispatchSlashCommandCreateEvent(server == null ? api : server, server, interaction.getChannel().orElse(null), interaction.getUser(), slashCommandCreateEvent);
                    break;
                case USER:
                    UserContextMenuCommandEvent userContextMenuCommandEvent = new UserContextMenuCommandEventImpl(interaction);
                    api.getEventDispatcher().dispatchUserContextMenuCommandEvent(server, server, interaction.getChannel().orElse(null), interaction.getUser(), userContextMenuCommandEvent);
                    break;
                case MESSAGE:
                    MessageContextMenuCommandEvent messageContextMenuCommandEvent = new MessageContextMenuCommandEventImpl(interaction);
                    api.getEventDispatcher().dispatchMessageContextMenuCommandEvent(server, interaction.asMessageContextMenuInteraction().orElseThrow(AssertionError::new).getTarget().getId(), server, interaction.getChannel().orElse(null), interaction.getUser(), messageContextMenuCommandEvent);
                    break;
                default:
                    logger.info("Got application command interaction of unknown type <{}>. " + "Please contact the developer!", applicationCommandTypeId);
                    return;
            }
            break;
        case MESSAGE_COMPONENT:
            MessageComponentCreateEvent messageComponentCreateEvent = new MessageComponentCreateEventImpl(interaction);
            long messageId = messageComponentCreateEvent.getMessageComponentInteraction().getMessage().getId();
            api.getEventDispatcher().dispatchMessageComponentCreateEvent(server == null ? api : server, messageId, server, interaction.getChannel().orElse(null), interaction.getUser(), messageComponentCreateEvent);
            switch(componentType) {
                case BUTTON:
                    ButtonClickEvent buttonClickEvent = new ButtonClickEventImpl(interaction);
                    api.getEventDispatcher().dispatchButtonClickEvent(server == null ? api : server, messageId, server, interaction.getChannel().orElse(null), interaction.getUser(), buttonClickEvent);
                    break;
                case SELECT_MENU:
                    SelectMenuChooseEvent selectMenuChooseEvent = new SelectMenuChooseEventImpl(interaction);
                    api.getEventDispatcher().dispatchSelectMenuChooseEvent(server == null ? api : server, messageId, server, interaction.getChannel().orElse(null), interaction.getUser(), selectMenuChooseEvent);
                    break;
                default:
                    break;
            }
            break;
        case APPLICATION_COMMAND_AUTOCOMPLETE:
            AutocompleteCreateEvent autocompleteCreateEvent = new AutocompleteCreateEventImpl(interaction);
            api.getEventDispatcher().dispatchAutocompleteCreateEvent(server == null ? api : server, server, interaction.getChannel().orElse(null), interaction.getUser(), autocompleteCreateEvent);
            break;
        default:
            break;
    }
}
Also used : InteractionType(org.javacord.api.interaction.InteractionType) MessageComponentCreateEventImpl(org.javacord.core.event.interaction.MessageComponentCreateEventImpl) AutocompleteCreateEvent(org.javacord.api.event.interaction.AutocompleteCreateEvent) ButtonClickEvent(org.javacord.api.event.interaction.ButtonClickEvent) UserContextMenuInteractionImpl(org.javacord.core.interaction.UserContextMenuInteractionImpl) SelectMenuChooseEvent(org.javacord.api.event.interaction.SelectMenuChooseEvent) UserContextMenuCommandEvent(org.javacord.api.event.interaction.UserContextMenuCommandEvent) AutocompleteCreateEventImpl(org.javacord.core.event.interaction.AutocompleteCreateEventImpl) MessageContextMenuCommandEventImpl(org.javacord.core.event.interaction.MessageContextMenuCommandEventImpl) SlashCommandCreateEventImpl(org.javacord.core.event.interaction.SlashCommandCreateEventImpl) MessageComponentCreateEvent(org.javacord.api.event.interaction.MessageComponentCreateEvent) TextChannel(org.javacord.api.entity.channel.TextChannel) InteractionCreateEvent(org.javacord.api.event.interaction.InteractionCreateEvent) ServerImpl(org.javacord.core.entity.server.ServerImpl) UserImpl(org.javacord.core.entity.user.UserImpl) SelectMenuInteractionImpl(org.javacord.core.interaction.SelectMenuInteractionImpl) ApplicationCommandType(org.javacord.api.interaction.ApplicationCommandType) ComponentType(org.javacord.api.entity.message.component.ComponentType) MessageContextMenuInteractionImpl(org.javacord.core.interaction.MessageContextMenuInteractionImpl) InteractionCreateEventImpl(org.javacord.core.event.interaction.InteractionCreateEventImpl) AutocompleteInteractionImpl(org.javacord.core.interaction.AutocompleteInteractionImpl) MessageContextMenuCommandEvent(org.javacord.api.event.interaction.MessageContextMenuCommandEvent) SlashCommandInteractionImpl(org.javacord.core.interaction.SlashCommandInteractionImpl) SelectMenuChooseEventImpl(org.javacord.core.event.interaction.SelectMenuChooseEventImpl) ButtonInteractionImpl(org.javacord.core.interaction.ButtonInteractionImpl) UserContextMenuCommandEventImpl(org.javacord.core.event.interaction.UserContextMenuCommandEventImpl) MessageContextMenuInteractionImpl(org.javacord.core.interaction.MessageContextMenuInteractionImpl) UserContextMenuInteractionImpl(org.javacord.core.interaction.UserContextMenuInteractionImpl) SlashCommandInteractionImpl(org.javacord.core.interaction.SlashCommandInteractionImpl) InteractionImpl(org.javacord.core.interaction.InteractionImpl) SelectMenuInteractionImpl(org.javacord.core.interaction.SelectMenuInteractionImpl) ButtonInteractionImpl(org.javacord.core.interaction.ButtonInteractionImpl) AutocompleteInteractionImpl(org.javacord.core.interaction.AutocompleteInteractionImpl) ButtonClickEventImpl(org.javacord.core.event.interaction.ButtonClickEventImpl) SlashCommandCreateEvent(org.javacord.api.event.interaction.SlashCommandCreateEvent)

Example 3 with UserImpl

use of org.javacord.core.entity.user.UserImpl in project Javacord by BtoBastian.

the class PresenceUpdateHandler method dispatchUserStatusChangeEventIfChangeDetected.

private void dispatchUserStatusChangeEventIfChangeDetected(long userId, UserStatus newStatus, UserStatus oldStatus, Map<DiscordClient, UserStatus> newClientStatus, Map<DiscordClient, UserStatus> oldClientStatus) {
    UserImpl user = api.getCachedUserById(userId).map(UserImpl.class::cast).orElse(null);
    // Only dispatch the event if something changed
    boolean shouldDispatch = false;
    if (newClientStatus != oldClientStatus) {
        shouldDispatch = true;
    }
    for (DiscordClient client : DiscordClient.values()) {
        if (newClientStatus.get(client) != oldClientStatus.get(client)) {
            shouldDispatch = true;
        }
    }
    if (!shouldDispatch) {
        return;
    }
    UserChangeStatusEvent event = new UserChangeStatusEventImpl(api, userId, newStatus, oldStatus, newClientStatus, oldClientStatus);
    api.getEventDispatcher().dispatchUserChangeStatusEvent(api, user == null ? Collections.emptySet() : user.getMutualServers(), user == null ? Collections.emptySet() : Collections.singleton(user), event);
}
Also used : DiscordClient(org.javacord.api.entity.DiscordClient) UserChangeStatusEventImpl(org.javacord.core.event.user.UserChangeStatusEventImpl) UserChangeStatusEvent(org.javacord.api.event.user.UserChangeStatusEvent) UserImpl(org.javacord.core.entity.user.UserImpl)

Example 4 with UserImpl

use of org.javacord.core.entity.user.UserImpl in project Javacord by BtoBastian.

the class GuildMemberUpdateHandler method handle.

@Override
public void handle(JsonNode packet) {
    api.getPossiblyUnreadyServerById(packet.get("guild_id").asLong()).map(server -> (ServerImpl) server).ifPresent(server -> {
        MemberImpl newMember = new MemberImpl(api, server, packet, null);
        Member oldMember = server.getRealMemberById(newMember.getId()).orElse(null);
        api.addMemberToCacheOrReplaceExisting(newMember);
        if (oldMember == null) {
            // Should only happen shortly after startup and is unproblematic
            return;
        }
        if (!newMember.getNickname().equals(oldMember.getNickname())) {
            UserChangeNicknameEvent event = new UserChangeNicknameEventImpl(newMember, oldMember);
            api.getEventDispatcher().dispatchUserChangeNicknameEvent(server, server, newMember.getUser(), event);
        }
        if (!newMember.getServerAvatarHash().equals(oldMember.getServerAvatarHash())) {
            UserChangeServerAvatarEvent event = new UserChangeServerAvatarEventImpl(newMember, oldMember);
            api.getEventDispatcher().dispatchUserChangeServerAvatarEvent(server, server, newMember.getUser(), event);
        }
        if (newMember.isPending() != oldMember.isPending()) {
            UserChangePendingEvent event = new UserChangePendingEventImpl(oldMember, newMember);
            api.getEventDispatcher().dispatchUserChangePendingEvent(server, server, newMember.getUser(), event);
        }
        if (packet.has("roles")) {
            JsonNode jsonRoles = packet.get("roles");
            Collection<Role> newRoles = new HashSet<>();
            Collection<Role> oldRoles = oldMember.getRoles();
            Collection<Role> intersection = new HashSet<>();
            for (JsonNode roleIdJson : jsonRoles) {
                api.getRoleById(roleIdJson.asText()).map(role -> {
                    newRoles.add(role);
                    return role;
                }).filter(oldRoles::contains).ifPresent(intersection::add);
            }
            // Added roles
            Collection<Role> addedRoles = new ArrayList<>(newRoles);
            addedRoles.removeAll(intersection);
            for (Role role : addedRoles) {
                if (role.isEveryoneRole()) {
                    continue;
                }
                UserRoleAddEvent event = new UserRoleAddEventImpl(role, newMember);
                api.getEventDispatcher().dispatchUserRoleAddEvent((DispatchQueueSelector) role.getServer(), role, role.getServer(), newMember.getId(), event);
            }
            // Removed roles
            Collection<Role> removedRoles = new ArrayList<>(oldRoles);
            removedRoles.removeAll(intersection);
            for (Role role : removedRoles) {
                if (role.isEveryoneRole()) {
                    continue;
                }
                UserRoleRemoveEvent event = new UserRoleRemoveEventImpl(role, newMember);
                api.getEventDispatcher().dispatchUserRoleRemoveEvent((DispatchQueueSelector) role.getServer(), role, role.getServer(), newMember.getId(), event);
            }
        }
        if (newMember.getUser().isYourself()) {
            Set<Long> unreadableChannels = server.getTextChannels().stream().filter(((Predicate<ServerTextChannel>) ServerTextChannel::canYouSee).negate()).map(ServerTextChannel::getId).collect(Collectors.toSet());
            api.forEachCachedMessageWhere(msg -> unreadableChannels.contains(msg.getChannel().getId()), msg -> {
                api.removeMessageFromCache(msg.getId());
                ((MessageCacheImpl) msg.getChannel().getMessageCache()).removeMessage(msg);
            });
        }
        // https://github.com/discord/discord-api-docs/pull/1307#issuecomment-581561519
        if (oldMember.getUser() != null) {
            UserImpl oldUser = (UserImpl) oldMember.getUser();
            boolean userChanged = false;
            UserImpl updatedUser = oldUser.replacePartialUserData(packet.get("user"));
            if (packet.get("user").has("username")) {
                String newName = packet.get("user").get("username").asText();
                String oldName = oldUser.getName();
                if (!oldName.equals(newName)) {
                    dispatchUserChangeNameEvent(updatedUser, newName, oldName);
                    userChanged = true;
                }
            }
            if (packet.get("user").has("discriminator")) {
                String newDiscriminator = packet.get("user").get("discriminator").asText();
                String oldDiscriminator = oldUser.getDiscriminator();
                if (!oldDiscriminator.equals(newDiscriminator)) {
                    dispatchUserChangeDiscriminatorEvent(updatedUser, newDiscriminator, oldDiscriminator);
                    userChanged = true;
                }
            }
            if (packet.get("user").has("avatar")) {
                String newAvatarHash = packet.get("user").get("avatar").asText(null);
                String oldAvatarHash = oldUser.getAvatarHash().orElse(null);
                if (!Objects.deepEquals(newAvatarHash, oldAvatarHash)) {
                    dispatchUserChangeAvatarEvent(updatedUser, newAvatarHash, oldAvatarHash);
                    userChanged = true;
                }
            }
            if (userChanged) {
                api.updateUserOfAllMembers(updatedUser);
            }
        }
    });
}
Also used : UserChangeNameEventImpl(org.javacord.core.event.user.UserChangeNameEventImpl) Member(org.javacord.core.entity.user.Member) UserChangeServerAvatarEventImpl(org.javacord.core.event.user.UserChangeServerAvatarEventImpl) UserChangePendingEvent(org.javacord.api.event.user.UserChangePendingEvent) UserRoleRemoveEventImpl(org.javacord.core.event.server.role.UserRoleRemoveEventImpl) UserChangeAvatarEvent(org.javacord.api.event.user.UserChangeAvatarEvent) UserChangeAvatarEventImpl(org.javacord.core.event.user.UserChangeAvatarEventImpl) UserChangeNicknameEvent(org.javacord.api.event.user.UserChangeNicknameEvent) UserChangeServerAvatarEvent(org.javacord.api.event.user.UserChangeServerAvatarEvent) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) MessageCacheImpl(org.javacord.core.util.cache.MessageCacheImpl) UserRoleRemoveEvent(org.javacord.api.event.server.role.UserRoleRemoveEvent) UserChangePendingEventImpl(org.javacord.core.event.user.UserChangePendingEventImpl) ServerTextChannel(org.javacord.api.entity.channel.ServerTextChannel) JsonNode(com.fasterxml.jackson.databind.JsonNode) UserChangeDiscriminatorEventImpl(org.javacord.core.event.user.UserChangeDiscriminatorEventImpl) ServerImpl(org.javacord.core.entity.server.ServerImpl) Predicate(java.util.function.Predicate) UserImpl(org.javacord.core.entity.user.UserImpl) Collection(java.util.Collection) MemberImpl(org.javacord.core.entity.user.MemberImpl) Set(java.util.Set) Collectors(java.util.stream.Collectors) UserRoleAddEvent(org.javacord.api.event.server.role.UserRoleAddEvent) UserChangeNameEvent(org.javacord.api.event.user.UserChangeNameEvent) Objects(java.util.Objects) LoggerUtil(org.javacord.core.util.logging.LoggerUtil) Logger(org.apache.logging.log4j.Logger) User(org.javacord.api.entity.user.User) UserRoleAddEventImpl(org.javacord.core.event.server.role.UserRoleAddEventImpl) Role(org.javacord.api.entity.permission.Role) PacketHandler(org.javacord.core.util.gateway.PacketHandler) DiscordApi(org.javacord.api.DiscordApi) UserChangeNicknameEventImpl(org.javacord.core.event.user.UserChangeNicknameEventImpl) DispatchQueueSelector(org.javacord.core.util.event.DispatchQueueSelector) Collections(java.util.Collections) UserChangeDiscriminatorEvent(org.javacord.api.event.user.UserChangeDiscriminatorEvent) UserChangePendingEvent(org.javacord.api.event.user.UserChangePendingEvent) ArrayList(java.util.ArrayList) JsonNode(com.fasterxml.jackson.databind.JsonNode) UserChangeNicknameEventImpl(org.javacord.core.event.user.UserChangeNicknameEventImpl) UserChangePendingEventImpl(org.javacord.core.event.user.UserChangePendingEventImpl) ServerImpl(org.javacord.core.entity.server.ServerImpl) UserRoleRemoveEvent(org.javacord.api.event.server.role.UserRoleRemoveEvent) UserImpl(org.javacord.core.entity.user.UserImpl) Member(org.javacord.core.entity.user.Member) HashSet(java.util.HashSet) UserRoleAddEventImpl(org.javacord.core.event.server.role.UserRoleAddEventImpl) MemberImpl(org.javacord.core.entity.user.MemberImpl) UserChangeServerAvatarEventImpl(org.javacord.core.event.user.UserChangeServerAvatarEventImpl) Role(org.javacord.api.entity.permission.Role) UserRoleAddEvent(org.javacord.api.event.server.role.UserRoleAddEvent) ServerTextChannel(org.javacord.api.entity.channel.ServerTextChannel) MessageCacheImpl(org.javacord.core.util.cache.MessageCacheImpl) UserChangeServerAvatarEvent(org.javacord.api.event.user.UserChangeServerAvatarEvent) UserChangeNicknameEvent(org.javacord.api.event.user.UserChangeNicknameEvent) UserRoleRemoveEventImpl(org.javacord.core.event.server.role.UserRoleRemoveEventImpl)

Example 5 with UserImpl

use of org.javacord.core.entity.user.UserImpl in project Javacord by BtoBastian.

the class ReadyHandler method handle.

@Override
public void handle(JsonNode packet) {
    // Purge the cache first
    api.purgeCache();
    JsonNode guilds = packet.get("guilds");
    for (JsonNode guildJson : guilds) {
        if (guildJson.has("unavailable") && guildJson.get("unavailable").asBoolean()) {
            api.addUnavailableServerToCache(guildJson.get("id").asLong());
            continue;
        }
        new ServerImpl(api, guildJson);
    }
    // https://github.com/hammerandchisel/discord-api-docs/issues/184
    if (packet.has("private_channels")) {
        JsonNode privateChannels = packet.get("private_channels");
        for (JsonNode channelJson : privateChannels) {
            switch(ChannelType.fromId(channelJson.get("type").asInt())) {
                case PRIVATE_CHANNEL:
                    new PrivateChannelImpl(api, channelJson);
                    break;
                case GROUP_CHANNEL:
                    new GroupChannelImpl(api, channelJson);
                    break;
                default:
                    logger.warn("Unknown or unexpected channel type. Your Javacord version might be out of date!");
            }
        }
    }
    api.setYourself(new UserImpl(api, packet.get("user"), (MemberImpl) null, null));
}
Also used : ServerImpl(org.javacord.core.entity.server.ServerImpl) MemberImpl(org.javacord.core.entity.user.MemberImpl) UserImpl(org.javacord.core.entity.user.UserImpl) JsonNode(com.fasterxml.jackson.databind.JsonNode) PrivateChannelImpl(org.javacord.core.entity.channel.PrivateChannelImpl) GroupChannelImpl(org.javacord.core.entity.channel.GroupChannelImpl)

Aggregations

UserImpl (org.javacord.core.entity.user.UserImpl)12 ServerImpl (org.javacord.core.entity.server.ServerImpl)7 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 MemberImpl (org.javacord.core.entity.user.MemberImpl)6 DiscordApi (org.javacord.api.DiscordApi)5 User (org.javacord.api.entity.user.User)5 PacketHandler (org.javacord.core.util.gateway.PacketHandler)5 PrivateChannel (org.javacord.api.entity.channel.PrivateChannel)2 ServerTextChannel (org.javacord.api.entity.channel.ServerTextChannel)2 TextChannel (org.javacord.api.entity.channel.TextChannel)2 PrivateChannelImpl (org.javacord.core.entity.channel.PrivateChannelImpl)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 Objects (java.util.Objects)1 Set (java.util.Set)1 Predicate (java.util.function.Predicate)1 Collectors (java.util.stream.Collectors)1 Logger (org.apache.logging.log4j.Logger)1