Tabnine Logo
Suppliers.ofInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
ofInstance
method
in
com.atlassian.fugue.Suppliers

Best Java code snippets using com.atlassian.fugue.Suppliers.ofInstance (Showing top 9 results out of 315)

origin: com.atlassian.jira/jira-core

@Override
public Promise<Unit> deleteAttachmentContainerForIssue(@Nonnull final Issue issue)
{
  //noinspection NullableProblems
  return fileSystemAttachmentStore.fold(Suppliers.ofInstance(Promises.promise(Unit.VALUE)),
      new Function<FileBasedAttachmentStore, Promise<Unit>>()
  {
    @Override
    public Promise<Unit> apply(final FileBasedAttachmentStore fileBasedAttachmentStore)
    {
      return fileBasedAttachmentStore.deleteAttachmentContainerForIssue(issue);
    }
  });
}
origin: com.atlassian.jira/jira-core

  @Override
  protected int getCount(final Map<String, Object> context)
  {
    return WorkflowTransitionContext.getTransition(context).fold(Suppliers.ofInstance(0), new Function<ActionDescriptor, Integer>()
    {
      @Override
      public Integer apply(final ActionDescriptor input)
      {
        return input.getValidators() == null ? 0 : input.getValidators().size();
      }
    });
  }
}
origin: com.atlassian.plugins/base-hipchat-integration-plugin-api

public static SimpleHipChatTokenReference token(String token) {
  return new SimpleHipChatTokenReference(Suppliers.ofInstance(Promises.promise(token)));
}
origin: com.atlassian.jira/jira-core

  @Override
  protected int getCount(final Map<String, Object> context)
  {
    return WorkflowTransitionContext.getTransition(context).fold(Suppliers.ofInstance(0), new Function<ActionDescriptor, Integer>()
    {
      @Override
      public Integer apply(final ActionDescriptor input)
      {
        final ResultDescriptor result = input.getUnconditionalResult();
        return result != null && result.getPostFunctions() != null ? result.getPostFunctions().size() : 0 ;
      }
    });
  }
}
origin: com.atlassian.jira/jira-core

@Override
@Nonnull
public Option<ErrorCollection> errors()
{
  final Option<ErrorCollection> secondaryStoreErrors = secondaryAttachmentStore.errors();
  //noinspection NullableProblems
  return primaryAttachmentStore.errors().fold(
      Suppliers.ofInstance(secondaryStoreErrors),
      new com.google.common.base.Function<ErrorCollection, Option<ErrorCollection>>()
      {
        @Override
        public Option<ErrorCollection> apply(final ErrorCollection input)
        {
          if (secondaryStoreErrors.isDefined())
          {
            final ErrorCollection errorCollection = secondaryStoreErrors.get();
            input.addErrorCollection(errorCollection);
          }
          return Option.some(input);
        }
      });
}
origin: com.atlassian.addon.connect.hercules/hercules-ac

public static Result index()
{
  final Result resultPage = ok(index.render());
  return AcController.index(Suppliers.ofInstance(resultPage), descriptorSupplier());
}
origin: com.atlassian.jira/jira-core

public String getPostSetupRedirect(Option<String> origin) throws URISyntaxException
{
  final Option<Application> applicationWithPostInstall = getApplicationWithPostInstall();
  final Option<URI> postInstallUri = applicationWithPostInstall.flatMap(new Function<Application, Option<URI>>()
  {
    @Override
    public Option<URI> apply(final Application input)
    {
      return input.getPostInstallURI();
    }
  });
  final String rawUri = postInstallUri.getOrElse(getDefaultPostSetupURI()).toASCIIString();
  final String redirectWithOrigin = origin.fold(Suppliers.ofInstance(rawUri), new Function<String, String>()
  {
    @Override
    public String apply(final String input)
    {
      return addParameterToURI(rawUri, input);
    }
  });
  return redirectWithOrigin;
}
origin: com.atlassian.addon.connect.hercules/hercules-ac

@Override
public Option<Project> getConfigById(final String userId, final AcHost tenant, final Long configId)
{
  try
  {
    return JPA.withTransaction(() -> HerculesProject.findById(tenant.getKey(), configId).
        fold(Suppliers.ofInstance(Option.<Project>none()), new Function<HerculesProject, Option<Project>>()
        {
          @Nullable
          @Override
          public Option<Project> apply(@Nullable final HerculesProject input)
          {
            return Option.some(Project.toProject(input));
          }
        }));
  }
  catch (Throwable t)
  {
    LOGGER.error("Unknown error retrieving project with config id '" + configId + "'", t);
    return Option.none();
  }
}
origin: com.atlassian.addon.connect.hercules/hercules-ac

@Override
public Option<Project> getProjectById(final String userId, final AcHost tenant, final Long projectId)
{
  try
  {
    return JPA.withTransaction(() -> HerculesProject.findByProjectId(tenant.getKey(), projectId).
        fold(Suppliers.ofInstance(Option.<Project>none()), new Function<HerculesProject, Option<Project>>()
        {
          @Nullable
          @Override
          public Option<Project> apply(@Nullable final HerculesProject input)
          {
            return Option.some(Project.toProject(input));
          }
        }));
  }
  catch (Throwable t)
  {
    LOGGER.error("Unknown error retrieving project with id '" + projectId + "'", t);
    return Option.none();
  }
}
com.atlassian.fugueSuppliersofInstance

Popular methods of Suppliers

  • alwaysFalse

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JList (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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