All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hubspot.imap.protocol.command.search.SearchCommand Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
package com.hubspot.imap.protocol.command.search;

import com.hubspot.imap.protocol.command.BaseImapCommand;
import com.hubspot.imap.protocol.command.ImapCommandType;
import com.hubspot.imap.protocol.command.search.keys.SearchKey;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class SearchCommand extends BaseImapCommand {

  private List keys;

  public SearchCommand(SearchKey... keys) {
    super(ImapCommandType.SEARCH, keysAsString(keys));
    this.keys = Arrays.asList(keys);
  }

  private static String keysAsString(SearchKey[] keys) {
    return SPACE_JOINER.join(
      Arrays.asList(keys).stream().map(SearchKey::keyString).collect(Collectors.toList())
    );
  }

  public List getKeys() {
    return keys;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy