Package com.google.common.base

Examples of com.google.common.base.Function


  public static CheckedFuture immediateCheckedFuture(Object paramObject)
  {
    SettableFuture localSettableFuture = SettableFuture.create();
    localSettableFuture.set(paramObject);
    return makeChecked(localSettableFuture, new Function()
    {
      public Exception apply(Exception paramAnonymousException)
      {
        throw new AssertionError("impossible");
      }
View Full Code Here


  }

  public static CheckedFuture immediateFailedCheckedFuture(Exception paramException)
  {
    Preconditions.checkNotNull(paramException);
    return makeChecked(immediateFailedFuture(paramException), new Function()
    {
      public Exception apply(Exception paramAnonymousException)
      {
        return this.val$exception;
      }
View Full Code Here

    return this.parameters;
  }

  private Map parametersAsMap()
  {
    return Maps.transformValues(this.parameters.asMap(), new Function()
    {
      public ImmutableMultiset apply(Collection paramAnonymousCollection)
      {
        return ImmutableMultiset.copyOf(paramAnonymousCollection);
      }
View Full Code Here

  {
    StringBuilder localStringBuilder = new StringBuilder().append(this.type).append('/').append(this.subtype);
    if (!this.parameters.isEmpty())
    {
      localStringBuilder.append("; ");
      ListMultimap localListMultimap = Multimaps.transformValues(this.parameters, new Function()
      {
        public String apply(String paramAnonymousString)
        {
          return MediaType.TOKEN_MATCHER.matchesAllOf(paramAnonymousString) ? paramAnonymousString : MediaType.escapeAndQuote(paramAnonymousString);
        }
View Full Code Here

  }

  static String toStringImpl(Collection paramCollection)
  {
    StringBuilder localStringBuilder = newStringBuilderForCollection(paramCollection.size()).append('[');
    STANDARD_JOINER.appendTo(localStringBuilder, Iterables.transform(paramCollection, new Function()
    {
      public Object apply(Object paramAnonymousObject)
      {
        return paramAnonymousObject == this.val$collection ? "(this Collection)" : paramAnonymousObject;
      }
View Full Code Here

      super(paramEntryTransformer);
    }

    List transform(final Object paramObject, Collection paramCollection)
    {
      return Lists.transform((List)paramCollection, new Function()
      {
        public Object apply(Object paramAnonymousObject)
        {
          return Multimaps.TransformedEntriesListMultimap.this.transformer.transformEntry(paramObject, paramAnonymousObject);
        }
View Full Code Here

      this.transformer = ((Maps.EntryTransformer)Preconditions.checkNotNull(paramEntryTransformer));
    }

    Collection transform(final Object paramObject, Collection paramCollection)
    {
      return Collections2.transform(paramCollection, new Function()
      {
        public Object apply(Object paramAnonymousObject)
        {
          return Multimaps.TransformedEntriesMultimap.this.transformer.transformEntry(paramObject, paramAnonymousObject);
        }
View Full Code Here

    public Collection values()
    {
      if (this.values == null)
      {
        Collection localCollection = Collections2.transform(this.fromMultimap.entries(), new Function()
        {
          public Object apply(Map.Entry paramAnonymousEntry)
          {
            return Multimaps.TransformedEntriesMultimap.this.transformer.transformEntry(paramAnonymousEntry.getKey(), paramAnonymousEntry.getValue());
          }
View Full Code Here

    return new UnmodifiableIterable(local14, null);
  }

  private static Function toIterator()
  {
    return new Function()
    {
      public Iterator apply(Iterable paramAnonymousIterable)
      {
        return paramAnonymousIterable.iterator();
      }
View Full Code Here

    {
      localObject1 = (Multiset)paramIterable;
      if (hasSameComparator(paramComparator, paramIterable))
        return ((Multiset)localObject1).entrySet();
      localArrayList1 = Lists.newArrayList(((Multiset)localObject1).entrySet());
      Collections.sort(localArrayList1, Ordering.from(paramComparator).onResultOf(new Function()
      {
        public Object apply(Multiset.Entry paramAnonymousEntry)
        {
          return paramAnonymousEntry.getElement();
        }
View Full Code Here

TOP

Related Classes of com.google.common.base.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.