net.sf.staccatocommons.lang.function
Class AbstractFunction<A,B>

java.lang.Object
  extended by net.sf.staccatocommons.lang.function.AbstractDelayable<A,B>
      extended by net.sf.staccatocommons.lang.function.AbstractFunction<A,B>
Type Parameters:
A - function argument type
B - function return type
All Implemented Interfaces:
Applicable<A,B>, Delayable<A,B>, Function<A,B>, NullSafeAware<Function<A,B>>
Direct Known Subclasses:
AbstractFunction.Soft

public abstract class AbstractFunction<A,B>
extends AbstractDelayable<A,B>
implements Function<A,B>

Author:
flbulgarelli

Nested Class Summary
static class AbstractFunction.Soft<A,B>
          AbstractFunction that handles exceptions by softening them using SoftException.soften(Throwable)
 
Constructor Summary
AbstractFunction()
           
 
Method Summary
 Predicate<A> equal(B object)
          equivalent to then(Predicates.equal(object))
 boolean isIdentity()
           
 Predicate<A> notNull()
          equivalent to then(Predicates.notNull());
 Predicate<A> null_()
          then(Predicates.null_())
 Function<A,B> nullSafe()
           
<C> Function<C,B>
of(Applicable<? super C,? extends A> other)
           
<Tp1,Tp2> Function2<Tp1,Tp2,B>
of(Applicable2<Tp1,Tp2,? extends A> other)
           
<Tp1,Tp2,Tp3>
Function3<Tp1,Tp2,Tp3,B>
of(Applicable3<Tp1,Tp2,Tp3,? extends A> other)
           
 Predicate<A> same(B object)
          equivalent to then(Predicates.same(object))
<C> Function<A,C>
then(Function<? super B,? extends C> other)
           
<A2,B2,C> Function2<A,A2,C>
then(Function2<B,B2,C> combinator, Function<? super A2,? extends B2> other)
           
 Predicate<A> then(Predicate<? super B> other)
           
 String toString()
           
 
Methods inherited from class net.sf.staccatocommons.lang.function.AbstractDelayable
delayed, delayedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.staccatocommons.defs.Applicable
apply
 
Methods inherited from interface net.sf.staccatocommons.defs.Delayable
delayed, delayedValue
 

Constructor Detail

AbstractFunction

public AbstractFunction()
Method Detail

of

@NonNull
public <C> Function<C,B> of(@NonNull
                                    Applicable<? super C,? extends A> other)
Specified by:
of in interface Function<A,B>

of

@NonNull
public <Tp1,Tp2> Function2<Tp1,Tp2,B> of(@NonNull
                                                 Applicable2<Tp1,Tp2,? extends A> other)
Specified by:
of in interface Function<A,B>

of

@NonNull
public <Tp1,Tp2,Tp3> Function3<Tp1,Tp2,Tp3,B> of(@NonNull
                                                         Applicable3<Tp1,Tp2,Tp3,? extends A> other)
Specified by:
of in interface Function<A,B>

nullSafe

@NonNull
public Function<A,B> nullSafe()
Specified by:
nullSafe in interface Function<A,B>
Specified by:
nullSafe in interface NullSafeAware<Function<A,B>>

then

public <C> Function<A,C> then(@NonNull
                              Function<? super B,? extends C> other)
Specified by:
then in interface Function<A,B>

then

public Predicate<A> then(@NonNull
                         Predicate<? super B> other)
Specified by:
then in interface Function<A,B>

equal

public Predicate<A> equal(B object)
equivalent to then(Predicates.equal(object))

Specified by:
equal in interface Function<A,B>

same

public Predicate<A> same(B object)
equivalent to then(Predicates.same(object))

Specified by:
same in interface Function<A,B>

notNull

public Predicate<A> notNull()
equivalent to then(Predicates.notNull());

Specified by:
notNull in interface Function<A,B>

null_

public Predicate<A> null_()
then(Predicates.null_())

Specified by:
null_ in interface Function<A,B>

then

public <A2,B2,C> Function2<A,A2,C> then(Function2<B,B2,C> combinator,
                                        Function<? super A2,? extends B2> other)
Specified by:
then in interface Function<A,B>

toString

public String toString()
Overrides:
toString in class Object

isIdentity

public boolean isIdentity()
Specified by:
isIdentity in interface Function<A,B>


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads