congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Pair.left
Code IndexAdd Tabnine to your IDE (free)

How to use
left
method
in
com.atlassian.fugue.Pair

Best Java code snippets using com.atlassian.fugue.Pair.left (Showing top 19 results out of 315)

origin: com.atlassian.jira/jira-api

public AttachmentsBulkOperationResult(final Pair<List<AttachmentError>, List<T>> errorAndResult)
{
  this(errorAndResult.left(), errorAndResult.right());
}
origin: com.atlassian.confluence/confluence-stateless-test-runner

private List<Pair<String, Option<Level>>> configureLevels()
{
  long start = System.currentTimeMillis();
  List<Pair<String, Option<Level>>> transformed = newArrayList();
  for (Pair<String, Option<Level>> level : levels)
  {
    Level newLevel = restClient.getAdminSession().getLoggingComponent().setLogLevel(level.left(), level.right().getOrNull());
    transformed.add(pair(level.left(), option(newLevel)));
  }
  LOG.info("Changed log levels in {}ms: {}", System.currentTimeMillis() - start, levels);
  return transformed;
}
origin: com.atlassian.plugins/atlassian-connect-server-core

public boolean allow(HttpServletRequest request) {
  if (!httpMethod.equals(request.getMethod())) {
    return false;
  }
  final String pathInfo = ServletUtils.extractPathInfo(request);
  if (path.equals(pathInfo)) {
    Optional<Pair<String, String>> maybeNamespaceAndName = getMethod(request);
    if (!maybeNamespaceAndName.isPresent()) {
      return false;
    }
    Pair<String, String> namespaceAndName = maybeNamespaceAndName.get();
    for (SoapScope scope : soapActions) {
      if (scope.match(namespaceAndName.left(), namespaceAndName.right())) {
        return true;
      }
    }
  }
  return false;
}
origin: com.atlassian.plugins/atlassian-connect-core

public boolean allow(HttpServletRequest request) {
  if (!httpMethod.equals(request.getMethod())) {
    return false;
  }
  final String pathInfo = ServletUtils.extractPathInfo(request);
  if (path.equals(pathInfo)) {
    Optional<Pair<String, String>> maybeNamespaceAndName = getMethod(request);
    if (!maybeNamespaceAndName.isPresent()) {
      return false;
    }
    Pair<String, String> namespaceAndName = maybeNamespaceAndName.get();
    for (SoapScope scope : soapActions) {
      if (scope.match(namespaceAndName.left(), namespaceAndName.right())) {
        return true;
      }
    }
  }
  return false;
}
origin: com.atlassian.jira/jira-core

public <T extends Enum<T>> Either<ErrorCollection, OrderByRequest<T>> parse(String orderByValue, Class<T> fields)
{
  Pair<Order, String> orderAndField = extractOrderAndField(orderByValue);
  Order order = orderAndField.left();
  String value = orderAndField.right();
  for (T field : fields.getEnumConstants())
  {
    if (field.toString().equalsIgnoreCase(value))
    {
      return Either.right(new OrderByRequest<T>(field, order));
    }
  }
  return Either.<ErrorCollection, OrderByRequest<T>>left(new SimpleErrorCollection(i18n.getText("util.errors.order.query.parse",
      value, Arrays.toString(fields.getEnumConstants())), ErrorCollection.Reason.VALIDATION_FAILED));
}
origin: com.atlassian.plugins/atlassian-connect-core

public Translations download(ConnectAddonBean addonBean) throws TranslationsDownloadException {
  List<DownloadResult<ResponsePromise>> downloadsInProgress =
      Stream.of(Language.values())
          .map(lang ->
              pair(lang, lang.getPath(addonBean.getTranslations().getPaths())))
          .filter(langAndPath ->
              langAndPath.right().isPresent())
          .map(langAndPath ->
              scheduleDownload(langAndPath.left(), addonBean.getBaseUrl(), langAndPath.right().get()))
          .collect(toList());
  final Map<Language, I18nKeysMapping> translations = downloadsInProgress.stream()
      .map(this::download)
      .collect(Collectors.toMap(DownloadResult::getLanguage, DownloadResult::getResult));
  return Translations.from(translations);
}
origin: com.atlassian.plugins/atlassian-connect-core

  /**
   * This method gathers errors from all failed installations and combines them into one message.
   */
  private String describeAllFailures(List<MarketplaceInstallationResult> installations) {
    return installations.stream()
        .filter(MarketplaceInstallationResult::failed)
        .map(failure -> failure
            .getException().map(ex -> ex.getI18nKey() != null ? pair(ex.getI18nKey(), ex.getI18nArgs()) : null)
            .orElse(pair(failure.getError().get().getI18nKey(), new String[]{failure.getAddonKey()})))
        .map(pair -> i18nResolver.getText(pair.left(), pair.right()))
        .collect(Collectors.joining(" "));
  }
}
origin: com.atlassian.jira/jira-core

private Map<String, VersionAndFile> getInstalledPluginVersions()
{
  final File[] installedPluginFiles = pluginTargetFolder.listFiles(ApplicationSource::jarsOnly);
  if (ArrayUtils.isNotEmpty(installedPluginFiles))
  {
    return stream(installedPluginFiles)
        .map(file -> new Pair<>(file, versionDiscovery.getBundleNameAndVersion(file)))
        .collect(Collectors.toMap(
            fileAndVersion -> fileAndVersion.right().getSymbolicName(),
            fileAndVersion -> new VersionAndFile(fileAndVersion.right().getVersion(), fileAndVersion.left()),
            PluginBundleInstaller::useNewestVersion
        ));
  }
  return ImmutableMap.of();
}
origin: com.atlassian.jira/jira-core

private Properties getPropertiesFromPlugin(final Pair<ResourceDescriptor, Plugin> pluginFeatureDesc)
{
  return loadRequiredProperties(
      path -> resourceLoader.getResourceAsStream(pluginFeatureDesc.right(), path),
      pluginFeatureDesc.left().getLocation());
}
origin: com.atlassian.confluence/confluence-stateless-test-runner

LOG.info("Enabling plugin {}", pair.left().getKey());
restPluginComponent.enablePlugin(pair.left());
LOG.info("Disabling plugin {}", pair.left().getKey());
restPluginComponent.disablePlugin(pair.left());
  final String moduleKey = moduleKeyStatusEntry.left();
  final boolean shouldEnable = moduleKeyStatusEntry.right();
origin: com.atlassian.labs.hipchat/hipchat-for-jira-plugin

  @Override
  public Void call() throws Exception {
    final Collection<EventMatcherType> eventMatcherTypes = issueEventToEventMatcherTypeConverter.match(event);
    List<ListenableFuture<Iterable<Pair<JiraIssueEvent, NotificationInfo>>>> futures = new ArrayList<>();
    // Multiple events can be fired for a given {@link IssueEvent}, multiple notifications
    // can be sent as a result so they are filtered below
    for (EventMatcherType eventMatcherType : eventMatcherTypes) {
      JiraIssueEvent jiraIssueEvent = new DefaultJiraIssueEvent.Builder(issueEventHelperBridge)
          .setEventMatcher(eventMatcherType)
          .setIssueEvent(event)
          .build();
      futures.add(taskExecutorService.submitTask(taskBuilder.newDedicatedRoomProcessorTask(jiraIssueEvent)));
      futures.add(taskExecutorService.submitTask(taskBuilder.newEventProcessorTask(jiraIssueEvent)));
    }
    try {
      for (Pair<JiraIssueEvent, NotificationInfo> ni : filterDuplicateMessages(futures)) {
        taskExecutorService.submitTask(taskBuilder.newSendNotificationTask(ni.left(),
                                          Collections.singleton(ni.right())));
      }
    } catch (Exception e) {
      LOG.error("Error processing event", e);
    }
    return null;
  }
});
origin: com.atlassian.confluence/confluence-webdriver-pageobjects

@Override
public StreamItem apply(final PageElement input) {
  final Pair<Maybe<String>, String> author = extractAuthor(input);
  return new StreamItem(extractTitle(input), author.left(), author.right(), extractIcons(input), extractCountItems(input));
}
origin: com.atlassian.jira/jira-core

  @Override
  public Void get(final Pair<Attachment, AttachmentKey> input)
  {
    final Promise<Attachment> op =
        attachmentStore.putAttachment(input.left(), source.getAttachmentFile(input.right()))
          .fail(new Effect<Throwable>()
          {
            @Override
            public void apply(final Throwable throwable)
            {
              abortCause.set(Option.some(throwable));
            }
          });
    onCompleteAttachment.foreach(new com.atlassian.fugue.Effect<Effect<Attachment>>()
    {
      @Override
      public void apply(final Effect<Attachment> attachmentEffect)
      {
        op.done(attachmentEffect);
      }
    });
    return null;
  }
}, ExceptionPolicy.Policies.THROW);
origin: com.atlassian.confluence/confluence-stateless-test-runner

Plugin plugin = pair.left();
boolean shouldEnable = pair.right();
boolean mutated = false;
    String moduleKey = moduleKeyStatusEntry.left();
    final Boolean shouldEnable = moduleKeyStatusEntry.right();
    final boolean currentlyEnabled = restPluginComponent.isPluginModuleEnabled(plugin, moduleKey);
origin: com.atlassian.jira/jira-core

for (final Pair<Long, Either<AttachmentError, Attachment>> result : results)
  map.put(result.left(), result.right());
origin: com.atlassian.maven.plugins/maven-amps-plugin

Pair<Pair<DefaultArtifactVersion,PomVersionElement>,ProjectRewriter> versionInfo = getVersionAndRewriter(project);
DefaultArtifactVersion versionInPom = versionInfo.left().left();
PomVersionElement pomElement = versionInfo.left().right();
String pomElementType = pomElement.getType();
String versionProp = pomElement.getVersionProperty();
origin: com.atlassian.confluence.plugins/confluence-mentions-plugin

final Content content = contentForId.left();
final String contentType = contentForId.right();
origin: com.atlassian.confluence/confluence-stateless-test-runner

final ArtifactResult artifactResult = pair.left().resolveArtifact(pair.right(), request);
if (artifactResult.isMissing())
origin: com.atlassian.confluence.plugin/func-test

final ArtifactResult artifactResult = pair.left().resolveArtifact(pair.right(), request);
if (artifactResult.isMissing())
com.atlassian.fuguePairleft

Popular methods of Pair

  • pair
  • right
  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JLabel (javax.swing)
  • Join (org.hibernate.mapping)
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now