Codota Logo
Either$LeftProjection.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
com.atlassian.fugue.Either$LeftProjection

Best Java code snippets using com.atlassian.fugue.Either$LeftProjection.get (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: com.atlassian.jira/jira-core

private static <T> List<T> transformRequiredElements(Element element, String elementName, final Function<Element, Either<T, IndexDocumentConfigurationParseException>> function)
    throws IndexDocumentConfigurationParseException
{
  @SuppressWarnings ("unchecked") final List<Element> childElements = element.elements(elementName);
  if (childElements.size() < 1)
  {
    throw new IndexDocumentConfigurationParseException(MessageFormat.format("Expected at least one {0} element", elementName));
  }
  final ImmutableList.Builder<T> listBuilder = ImmutableList.builder();
  for (final Element childElement : childElements)
  {
    final Either<T, IndexDocumentConfigurationParseException> output = function.apply(childElement);
    if (output.isLeft())
    {
      listBuilder.add(output.left().get());
    }
    else
    {
      throw output.right().get();
    }
  }
  return listBuilder.build();
}
origin: com.atlassian.jira/jira-webhooks-plugin

public void validateFilter(final MessageCollection.Builder errorCollectionBuilder, final Optional<String> filter) {
  if (filter.isPresent() && StringUtils.isNotBlank(filter.get())) {
    final String jql = filter.get();
    final Either<JqlParseException, String> jqlValid = isJqlValid(jql);
    if (!jqlValid.isRight()) {
      final Message errorMessage = new ErrorMessage("jql", i18n.getText("webhooks.invalid.jql", jql, jqlValid.left().get()));
      errorCollectionBuilder.addMessage(errorMessage, MessageCollection.Reason.VALIDATION_FAILED);
    }
  }
}
origin: com.atlassian.jira/jira-tests

@Override
protected boolean matchesSafely(final Either<L, R> item, final Description mismatchDescription)
{
  if (!item.isLeft())
  {
    mismatchDescription.appendText("RIGHT[")
        .appendValue(item.right().get())
        .appendText("]");
    return false;
  }
  else if (!matcher.matches(item.left().get()))
  {
    mismatchDescription.appendText("LEFT[");
    describeMismatch(item.left().get(), mismatchDescription);
    mismatchDescription.appendText("]");
    return false;
  }
  else
  {
    return true;
  }
}
origin: com.atlassian.jira/jira-core

@Override
public Promise<Unit> moveTemporaryToAttachment(final TemporaryAttachmentId temporaryAttachmentId, final AttachmentKey destinationKey)
{
  final Either<Exception, File> tempFileEitherException = localTemporaryFileStore.getTemporaryAttachmentFile(temporaryAttachmentId);
  if (tempFileEitherException.isLeft())
  {
    return Promises.rejected(tempFileEitherException.left().get());
  }
  final File tempFile = tempFileEitherException.right().get();
  final File destinationFile = getAttachmentFileHolder(destinationKey);
  return moveFile(tempFile, destinationFile, true);
}
origin: com.atlassian.jira/jira-core

public PermissionGrant getGrant()
{
  return actual.left().get();
}
origin: com.atlassian.cpji/cpji-jira-plugin

  @Override
  public Either<NegativeResponseStatus, Projects> apply(JiraProxy input) {
    Either<NegativeResponseStatus, PluginVersion> version = input.isPluginInstalled();
    if(version.isLeft())
      return Either.left(version.left().get());
    if(version.right().get().getResult().equals(PluginInfoResource.PLUGIN_VERSION)){
      return input.getProjects();
    } else {
      return Either.left(NegativeResponseStatus.unsupportedVersion(input.getJiraLocation()));
    }
  }
});
origin: com.atlassian.plugin.automation/automation-module

@Override
public Either<RuleErrors, RuleValidationResult> validateUpdateRule(String remoteUsername, Rule rule)
{
  final Either<ErrorCollection, Rule> getRuleResult = getRule(remoteUsername, rule.getId());
  if (getRuleResult.isLeft())
  {
    return Either.left(new RuleErrors(getRuleResult.left().get(), new ErrorCollection(), Lists.<ErrorCollection>newArrayList()));
  }
  final RuleErrors ruleErrors = validateCompleteRule(remoteUsername, rule);
  if (ruleErrors.hasAnyErrors())
  {
    return Either.left(ruleErrors);
  }
  return Either.right(new RuleValidationResult(rule));
}
origin: com.atlassian.cpji/cpji-jira-plugin

  public static ResultWithJiraLocation<?> extract(Either<? extends ResultWithJiraLocation<?>, ? extends ResultWithJiraLocation<?>> either) {
    if (either.isLeft()) {
      return either.left().get();
    } else {
      return either.right().get();
    }
  }
}
origin: com.atlassian.jira/jira-core

@Override
public ValidationResult validate(@Nonnull final I18nHelper i18nHelper, @Nonnull final String licenseString)
{
  LicenseValidationHelper helper = new LicenseValidationHelper(i18nHelper, helpUrls);
  Either<String, LicenseDetails> errorOrLicenseDetails = helper.decodeLicenseDetails(licenseString, licenseManager)
      .flatMap(helper.validateLicenseTypeAndVersion(isDataCenterConfigured(), MIN_LICENSE_VERSION));
  int totalUserCount = userManager.getTotalUserCount();
  if (errorOrLicenseDetails.isLeft())
  {
    OurValidationResult validationResult = new OurValidationResult(totalUserCount, licenseString, null);
    validationResult.addError(errorOrLicenseDetails.left().get());
    return validationResult;
  }
  else
  {
    return new OurValidationResult(totalUserCount, licenseString, errorOrLicenseDetails.right().get());
  }
}
origin: com.atlassian.jira/jira-api

@Deprecated
public final static String getEntityToken(Either<Issue, Project> entity)
{
  if (entity == null)
  {
    return null;
  }
  if (entity.isLeft())
  {
    return getIssueToken(entity.left().get());
  }
  else if (entity.isRight())
  {
    return getProjectToken(entity.right().get());
  }
  else
  {
    return null;
  }
}
origin: com.atlassian.jira/jira-core

private void cloneAttachmentsIfNeeded(Issue clone) throws CreateException
{
  /*
   * Note, that Create Attachment permission is not checked,
   * the same way Link Issue permission is not checked for cloning links.
   */
  if (isCloneAttachments() && attachmentManager.attachmentsEnabled())
  {
    Map<Long, Either<AttachmentError, Attachment>> result =
        attachmentManager.copyAttachments(originalIssue, getLoggedInUser(), clone.getKey());
    for (final Either<AttachmentError, Attachment> either : result.values())
    {
      if (either.isLeft()) {
        final AttachmentError error = either.left().get();
        log.warn(error.getLogMessage(), error.getException().getOrNull());
      }
    }
  }
}
origin: com.atlassian.jira/jira-gadgets-plugin

@Override
public Either<List<ProjectVersionBean>, ErrorCollection> getVersions(@Nonnull final String jql)
{
  ApplicationUser user = authenticationContext.getUser();
  Either<Query, ErrorCollection> queryOrError = queryParser.getQuery(user, jql);
  if (queryOrError.isRight())
  {
    return Either.right(queryOrError.right().get());
  }
  Query query = queryOrError.left().get();
  Option<Query> filterQuery = projectOrFilterQueryParser.getFilterQuery(user, query);
  if (filterQuery.isDefined())
  {
    query = filterQuery.get();
  }
  Collection<Project> projects = getProjectsForQuery(user, query);
  List<ProjectVersionBean> projectVersionBeanList = getVersionsForProjects(query, projects);
  return Either.left(projectVersionBeanList);
}
origin: com.atlassian.plugins/atlassian-connect-core

  @SuppressWarnings("unchecked")
  @Override
  public RegistrationResult onModule(ConnectModuleProviderModuleDescriptor moduleDescriptor, ConnectModuleProvider<?> provider) {
    final String descriptorKey = provider.getMeta().getDescriptorKey();
    final Collection moduleBeans = builtModuleList.get(descriptorKey);
    if (moduleBeans == null) return RegistrationResult.emptyFor(provider);
    if (vertigoState.isVertigoSpiEnabled()) {
      final Either<GenerationResult, RegistrationResult> potentialDescriptors = BeanToModuleRegistrar.this.getDescriptorsToRegisterForModulesVertigoStyle(provider, moduleBeans, addon, translations);
      if (potentialDescriptors.isRight()) {
        return potentialDescriptors.right().get();
      } else {
        if (potentialDescriptors.left().get() != GenerationResult.NOT_IMPLEMENTED && systemPropertyService.isVertigoFallbackDisabled()) {
          throw new IllegalStateException("The module provider " + provider.getClass() + " implemented serializeToPluginModules but failed to run the whole process. Fallback disabled: failing hard.");
        }
      }
    }
    return new RegistrationResult(provider, provider.createPluginModuleDescriptors(ImmutableList.copyOf(moduleBeans), addon), ImmutableList.of());
  }
});
origin: com.atlassian.cpji/cpji-jira-plugin

@Override
public Either<NegativeResponseStatus, SuccessfulResponse> addAttachment(String issueKey, Attachment attachment) {
  Either<AttachmentError, Attachment> result = attachmentManager.copyAttachment(attachment, jiraAuthenticationContext.getUser(), issueKey);
  if (result.isLeft()) {
    return Either.left(NegativeResponseStatus.errorOccured(jiraLocation, result.left().get().getLogMessage()));
  }
  return Either.right(SuccessfulResponse.build(jiraLocation));
}
origin: com.atlassian.jira/jira-rest-plugin

private Response.ResponseBuilder withApplicationRole(String key, Function<ApplicationRole, Response.ResponseBuilder> valid)
{
  final Either<Response.ResponseBuilder, ApplicationRole> appRoleEither = getApplicationRole(key);
  if (appRoleEither.isLeft())
  {
    return appRoleEither.left().get();
  }
  return valid.apply(appRoleEither.right().get());
}
origin: com.atlassian.jira/jira-rest-plugin

  @Override
  public Response apply(@Nullable final Project project)
  {
    Either<Project, com.atlassian.jira.util.ErrorCollection> updateResult = projectService.updateProjectType(authContext.getLoggedInUser(), project, new ProjectTypeKey(newProjectTypeKey));
    if (updateResult.isLeft())
    {
      return responses.okNoCache(projectBeanFactory.fullProject(updateResult.left().get(), ""));
    }
    return responses.errorResponse(updateResult.right().get());
  }
});
origin: com.atlassian.jira/jira-tests

@Override
protected boolean matchesSafely(final Either<L, R> item, final Description mismatchDescription)
{
  if (!item.isRight())
  {
    mismatchDescription.appendText("LEFT[")
        .appendValue(item.left().get())
        .appendText("]");
    return false;
  }
  else if (!matcher.matches(item.right().get()))
  {
    mismatchDescription.appendText("RIGHT[");
    matcher.describeMismatch(item.right().get(), mismatchDescription);
    mismatchDescription.appendText("]");
    return false;
  }
  else
  {
    return true;
  }
}
origin: com.atlassian.jira/jira-core

  @Override
  public ErrorCollection apply(final ApplicationUser user, final ChangeHistory changeGroup)
  {
    Either<ErrorCollection, Issue> issue = getIssueFromChangeHistory(changeGroup);
    if (issue.isLeft()) {
      return issue.left().get();
    }
    return issuePermissionFunction.apply(user, issue.right().get());
  }
}
origin: com.atlassian.jira/jira-core

  @Override
  public ServiceResult perform() throws GenericEntityException
  {
    if (id.equals(permissionSchemeManager.getDefaultSchemeObject().getId()))
    {
      return fail(i18n.getText("admin.schemes.permissions.cannot.delete.default.scheme"), Reason.VALIDATION_FAILED);
    }
    Either<ServiceOutcome<Object>, PermissionScheme> schemeToDelete = getScheme(user, id);
    if (schemeToDelete.isRight())
    {
      if (!permissionSchemeManager.getProjects(representationConverter.scheme(schemeToDelete.right().get())).isEmpty())
      {
        return fail(i18n.getText("admin.schemes.permissions.cannot.delete.with.projects", id), Reason.VALIDATION_FAILED);
      }
      permissionSchemeManager.deleteScheme(id);
      return ok();
    }
    else
    {
      return schemeToDelete.left().get();
    }
  }
});
origin: com.atlassian.jira/jira-core

private ServiceOutcome<Date> parseDateFromEither(ApplicationUser user, DateField field, Either<String, Date> date)
{
  if (date.isLeft())
  {
    try
    {
      return ServiceOutcomeImpl.ok(parseDate(user, field, date.left().get()));
    }
    catch (DateParseException e)
    {
      return new ServiceOutcomeImpl<Date>(e.parseErrors);
    }
  }
  else
  {
    return ok(date.right().get());
  }
}
com.atlassian.fugueEither$LeftProjectionget

Popular methods of Either$LeftProjection

  • getOrNull
  • map
  • on

Popular in Java

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now