Tabnine Logo
Options
Code IndexAdd Tabnine to your IDE (free)

How to use
Options
in
com.atlassian.fugue

Best Java code snippets using com.atlassian.fugue.Options (Showing top 10 results out of 315)

origin: com.atlassian.jira/jira-core

private Iterable<JqlAlias> createAliases(final Iterable<KeyConfigurationWrapper> indexConfigurations)
{
  final Iterable<Iterable<Option<JqlAlias>>> aliases = transform(indexConfigurations, new Function<KeyConfigurationWrapper, Iterable<Option<JqlAlias>>>()
  {
    @Override
    public Iterable<Option<JqlAlias>> apply(final KeyConfigurationWrapper keyConfigurationWrapper)
    {
      return transform(keyConfigurationWrapper.getKeyConfiguration().getExtractorConfigurations(), new Function<ExtractConfiguration, Option<JqlAlias>>()
      {
        @Override
        public Option<JqlAlias> apply(final ExtractConfiguration extractConfiguration)
        {
          return extractConfiguration.getAlias().map(new Function<String, JqlAlias>()
          {
            @Override
            public JqlAlias apply(final String alias)
            {
              return jqlAliasFactory.createAlias(keyConfigurationWrapper.pluginKey,
                  keyConfigurationWrapper.getKeyConfiguration().getPropertyKey(),
                  extractConfiguration,
                  alias);
            }
          });
        }
      });
    }
  });
  return flatten(concat(aliases));
}
origin: com.atlassian.labs.hipchat/hipchat-for-jira-plugin

@Nonnull
@Override
public Iterable<E> getAll() {
  final Function<K, Option<E>> getAllAsOptionsF = new Function<K, Option<E>>() {
    @Override
    public Option<E> apply(K key) {
      return get(key);
    }
  };
  final Function<Option<E>, E> getAllF = new Function<Option<E>, E>() {
    @Override
    public E apply(Option<E> input) {
      return input.get();
    }
  };
  return ImmutableList.copyOf(transform(Options.filterNone(transform(getKeys(), getAllAsOptionsF)), getAllF));
}
origin: com.atlassian.jira/jira-core

final Function<Either<Failure, Option<A>>, Promise<A>> fold = fold(failure, result);
return getBlobStore()
    .get(attachmentId, FOREVER_CACHE, Options.lift(compose(toGoogleFunction(attachmentGetDataProcessor), dataFromResult)))
    .flatMap(fold);
origin: com.atlassian.plugins/atlassian-connect-host-spi

private Iterable<ContextParametersValidator<T>> getValidatorsFromPlugins() {
  final Collection<ConnectContextParameterResolverModuleDescriptor.ConnectContextParametersResolver> modules =
      pluginAccessor.getModules(new ModuleDescriptorOfClassPredicate<>(ConnectContextParameterResolverModuleDescriptor.class));
  Iterable<ContextParametersValidator> validators =
      concat(transform(modules, ConnectContextParameterResolverModuleDescriptor.ConnectContextParametersResolver::getValidators));
  return Options.flatten(transform(validators, AbstractModuleContextFilter.this::tryCast));
}
origin: com.atlassian.jira/jira-core

private String renderCommentFields(final DescriptorToHtmlFunction descriptorToHtmlFunction, final CommentHelper commentHelper)
{
  Iterable<CommentFieldRendererModuleDescriptor> descriptors = pluginAccessor.getEnabledModuleDescriptorsByClass(CommentFieldRendererModuleDescriptor.class);
  List<CommentFieldRendererModuleDescriptor> descriptorsOrderedByWeight = commentFieldRendererModuleDescriptorOrdering.sortedCopy(descriptors);
  // Complicated? Not really. We get all renders for which want to be displayed (according to the condition).
  // Then, transform all this to optional html (there might be no definition of field-view-resource, when we would get none).
  // Finally, pick the first non empty html.
  final Option<String> commentFieldToRender = getFirst(Options.filterNone(transform(filter(descriptorsOrderedByWeight, SafePluginPointAccess.safe(new Predicate<CommentFieldRendererModuleDescriptor>()
  {
    @Override
    public boolean apply(final CommentFieldRendererModuleDescriptor moduleDescriptor) {
      return moduleDescriptor.getCondition() == null || moduleDescriptor.getCondition().shouldDisplay(commentHelper.getContextParams());
    }
  })), SafePluginPointAccess.safe(descriptorToHtmlFunction))), Option.<String>none());
  return commentFieldToRender.getOrError(new Supplier<String>()
  {
    @Override
    public String get()
    {
      throw new IllegalStateException("There should be at least one comment field renderer, which can render the comments");
    }
  });
}
origin: com.atlassian.plugins/atlassian-connect-spi

private Iterable<ContextParametersValidator<T>> getValidatorsFromPlugins()
{
  Iterable<ContextParametersValidator> validators = Iterables.concat(Iterables.transform(pluginAccessor.getModules(
          new ModuleDescriptorOfClassPredicate<>(ConnectContextParameterResolverModuleDescriptor.class)),
      new Function<ConnectContextParameterResolverModuleDescriptor.ConnectContextParametersResolver, List<ContextParametersValidator>>() {
        @Override
        public List<ContextParametersValidator> apply(final ConnectContextParameterResolverModuleDescriptor.ConnectContextParametersResolver input)
        {
          return input.getValidators();
        }
      }));
  return Options.flatten(Iterables.transform(validators, new Function<ContextParametersValidator, Option<ContextParametersValidator<T>>>()
  {
    @Override
    public Option<ContextParametersValidator<T>> apply(final ContextParametersValidator contextParametersValidator)
    {
      return tryCast(contextParametersValidator);
    }
  }));
}
origin: com.atlassian.jira/jira-core

public List<EntityProperty> getCommentProperties()
{
  // This is calculated in the getter for the reason. There is not a lot usages of comment properties, so it is better
  // to calculate this once this is needed.
  final ApplicationUser applicationUser = jiraAuthenticationContext.getUser();
  Iterable<Option<EntityProperty>> propOptions = transform(commentPropertyService.getPropertiesKeys(applicationUser, comment.getId()).getKeys(), new Function<String, Option<EntityProperty>>()
  {
    @Override
    public Option<EntityProperty> apply(final String propertyKey)
    {
      return commentPropertyService.getProperty(applicationUser, comment.getId(), propertyKey).getEntityProperty();
    }
  });
  return Lists.newArrayList(Options.flatten(propOptions));
}
origin: com.atlassian.jira/jira-core

private ErrorCollection validateCreate(@Nonnull final IssueTypeCreateInput issueTypeCreateInput)
{
  // noinspection unchecked
  final Iterable<ErrorCollection> errorCollections = Options.flatten(Lists.newArrayList(
      validateType(issueTypeCreateInput),
      validateName(issueTypeCreateInput.getName(), Option.<IssueType>none())
  ));
  return buildAllErrors(errorCollections);
}
origin: com.atlassian.jira/jira-core

public PermissionScheme permissionScheme(final Scheme scheme)
{
  return new PermissionSchemeImpl(
      scheme.getId(),
      scheme.getName(),
      scheme.getDescription(),
      flatten(transform(scheme.getEntities(), new Function<SchemeEntity, Option<PermissionGrant>>()
      {
        @Override
        public Option<PermissionGrant> apply(final SchemeEntity input)
        {
          return permissionGrant(input);
        }
      })));
}
origin: com.atlassian.jira/jira-api

return Lists.newArrayList(Options.flatten(propertyBeans));
com.atlassian.fugueOptions

Most used methods

  • flatten
  • filterNone
  • lift

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Collectors (java.util.stream)
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top plugins for WebStorm
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