| Package | Description |
|---|---|
| org.opencastproject.job.api | |
| org.opencastproject.mediapackage | |
| org.opencastproject.security.api | |
| org.opencastproject.security.util | |
| org.opencastproject.serviceregistry.api |
Service implementation classes
|
| org.opencastproject.util |
Utility classes for dealing with media packages, collections, URLs, files, and streams.
|
| org.opencastproject.util.data | |
| org.opencastproject.util.data.functions | |
| org.opencastproject.util.persistence |
| Modifier and Type | Field and Description |
|---|---|
static Function<Tuple<String,String>,JaxbIncidentDetail> |
JaxbIncidentDetail.mkFn |
static Function<Incident,JaxbIncident> |
JaxbIncident.mkFn |
static Function<Map.Entry<String,String>,JaxbIncident.Param> |
JaxbIncident.Param.mkFn |
static Function<IncidentTree,JaxbIncidentTree> |
JaxbIncidentTree.mkFn |
static Function<JaxbIncidentDetail,Tuple<String,String>> |
JaxbIncidentDetail.toDetailFn |
static Function<JaxbIncident,Incident> |
JaxbIncident.toIncidentFn |
static Function<JaxbIncidentTree,IncidentTree> |
JaxbIncidentTree.toIncidentTreeFn |
| Modifier and Type | Method and Description |
|---|---|
static Function<Incident,JaxbIncidentFull> |
JaxbIncidentFull.mkFn(IncidentService svc,
Locale locale) |
static Function<IncidentTree,JaxbIncidentDigestTree> |
JaxbIncidentDigestTree.mkFn(IncidentService svc,
Locale locale) |
static Function<Incident,JaxbIncidentDigest> |
JaxbIncidentDigest.mkFn(IncidentService svc,
Locale locale) |
static Function<IncidentTree,JaxbIncidentFullTree> |
JaxbIncidentFullTree.mkFn(IncidentService svc,
Locale locale) |
| Modifier and Type | Field and Description |
|---|---|
static Function<MediaPackageElementFlavor,Function<MediaPackageElement,Boolean>> |
MediaPackageSupport.Filters.matchesFlavor |
| Modifier and Type | Method and Description |
|---|---|
static Function<MediaPackageElement,List<MediaPackageElement>> |
MediaPackageSupport.Filters.byFlavor(MediaPackageElementFlavor flavor) |
static Function<MediaPackageElement,List<MediaPackageElement>> |
MediaPackageSupport.Filters.byTags(List<String> tags) |
static <A extends MediaPackageElement> |
MediaPackageSupport.Filters.byType(Class<A> type) |
static <A extends MediaPackageElement> |
MediaPackageElementParser.getAsXml()
|
static Function<MediaPackageElement,Boolean> |
MediaPackageSupport.Filters.hasTag(String tag) |
static Function<MediaPackageElement,Boolean> |
MediaPackageSupport.Filters.hasTagAny(List<String> tags)
Check if mediapackage element has any of the given tags.
|
static Function<MediaPackageElementFlavor,Boolean> |
MediaPackageSupport.Filters.matches(MediaPackageElementFlavor flavor)
MediaPackageElementFlavor.matches(MediaPackageElementFlavor) as a function. |
static Function<MediaPackageElement,Boolean> |
MediaPackageSupport.Filters.matchesFlavor(MediaPackageElementFlavor flavor)
Return true if the element has a flavor that matches
flavor. |
static Function<Publication,Boolean> |
MediaPackageSupport.Filters.ofChannel(String channelId)
Filters publications to channel
channelId. |
static Function<MediaPackageElement,Boolean> |
MediaPackageSupport.Filters.ofTags(List<String> tags)
MediaPackageElement.containsTag(java.util.Collection) as a function. |
static <A extends MediaPackageElement> |
MediaPackageSupport.Filters.ofType(Class<A> type) |
| Modifier and Type | Field and Description |
|---|---|
static Function<String,Either<Exception,AccessControlList>> |
AccessControlParser.parseAcl
Functional version of
AccessControlParser.parseAcl(String). |
static Function<String,AccessControlList> |
AccessControlParser.parseAclSilent
AccessControlParser.parseAclSilent(String) as a function. |
static Function<String,Option<AclScope>> |
AccessControlUtil.toAclScope |
static Function<AccessControlList,String> |
AccessControlParser.toJsonSilent |
| Modifier and Type | Method and Description |
|---|---|
<A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
TrustedHttpClient.run(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
|
| Modifier and Type | Method and Description |
|---|---|
<A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
TrustedHttpClient.run(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
|
| Modifier and Type | Method and Description |
|---|---|
Either<Exception,A> |
TrustedHttpClient.RequestRunner.run(Function<org.apache.http.HttpResponse,A> f)
Run the request and apply function
f to its response. |
| Modifier and Type | Method and Description |
|---|---|
<A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
StandAloneTrustedHttpClientImpl.run(org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
static <A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
StandAloneTrustedHttpClientImpl.run(TrustedHttpClient client,
org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
| Modifier and Type | Method and Description |
|---|---|
<A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
StandAloneTrustedHttpClientImpl.run(org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
static <A> Function<Function<org.apache.http.HttpResponse,A>,Either<Exception,A>> |
StandAloneTrustedHttpClientImpl.run(TrustedHttpClient client,
org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
| Modifier and Type | Field and Description |
|---|---|
static Function<org.apache.http.HttpResponse,Option<List<MediaPackageElement>>> |
RemoteBase.elementsFromHttpResponse |
| Modifier and Type | Method and Description |
|---|---|
protected <A> Option<A> |
RemoteBase.runRequest(org.apache.http.client.methods.HttpRequestBase req,
Function<org.apache.http.HttpResponse,A> f) |
| Modifier and Type | Method and Description |
|---|---|
static <A> Function<InputStream,A> |
IoSupport.closeAfterwards(Function<InputStream,? extends A> f)
Wrap function
f to close the input stream after usage. |
static Function<org.apache.http.HttpResponse,org.apache.http.HttpResponse> |
HttpUtil.expect(int... status)
Return the response if its status code equals one of the given statuses or throw an exception.
|
static Function<org.apache.http.HttpResponse,String> |
HttpUtil.getContentOn(int... status)
Return the content of the response as a string if its status code equals one of the given statuses.
|
static <A extends Enum> |
EnumSupport.parseEnum(A e)
Create a function to parse a string into an Enum value.
|
static Function<Job,MediaPackageElement> |
JobUtil.payloadAsMediaPackageElement(Job waiter,
ServiceRegistry reg)
Interpret the payload of a completed
Job as a MediaPackageElement. |
static Function<Job,MediaPackageElement> |
JobUtil.payloadAsMediaPackageElement(ServiceRegistry reg)
Interpret the payload of a completed
Job as a MediaPackageElement. |
static Function<Job,JobBarrier.Result> |
JobUtil.waitForJob(Job waiter,
ServiceRegistry reg,
Option<Long> timeout)
|
static Function<Job,JobBarrier.Result> |
JobUtil.waitForJob(ServiceRegistry reg,
Option<Long> timeout)
|
static Function<Job,Boolean> |
JobUtil.waitForJobSuccess(Job waiter,
ServiceRegistry reg,
Option<Long> timeout)
Wait for the job to complete and return the success value.
|
static Function<Job,Boolean> |
JobUtil.waitForJobSuccess(ServiceRegistry reg,
Option<Long> timeout)
Wait for the job to complete and return the success value.
|
| Modifier and Type | Method and Description |
|---|---|
<A> A |
JsonVal.as(Function<Object,? extends A> converter) |
<A> List<A> |
JsonArr.as(Function<Object,A> converter) |
static <A> Function<InputStream,A> |
IoSupport.closeAfterwards(Function<InputStream,? extends A> f)
Wrap function
f to close the input stream after usage. |
static <A> A |
IoSupport.locked(File file,
Function<File,A> f)
Run function
f having exclusive read/write access to the given file. |
static <A,B extends Closeable> |
IoSupport.withResource(B b,
Function<B,A> f)
Handle a closeable resource inside
f and ensure it gets closed properly. |
static <A,Err,B extends Closeable> |
IoSupport.withResource(Function0<B> r,
Function<Exception,Err> toErr,
Function<B,A> f)
Handle a closeable resource inside
f and ensure that r gets closed properly. |
static <A,Err,B extends Closeable> |
IoSupport.withResource(Function0<B> r,
Function<Exception,Err> toErr,
Function<B,A> f)
Handle a closeable resource inside
f and ensure that r gets closed properly. |
static <A,Err> Either<Err,A> |
IoSupport.withStream(Function0<InputStream> s,
Function<Exception,Err> toErr,
Function<InputStream,A> f)
|
static <A,Err> Either<Err,A> |
IoSupport.withStream(Function0<InputStream> s,
Function<Exception,Err> toErr,
Function<InputStream,A> f)
|
static <A> A |
IoSupport.withStream(InputStream s,
Function<InputStream,A> f)
Deprecated.
|
static <A> A |
IoSupport.withStream(OutputStream s,
Function<OutputStream,A> f)
Deprecated.
|
static <A,B> A |
ReflectionUtil.xfer(A target,
Class<B> source,
Function<A,? extends B> f)
Helper method for the transfer idiom.
|
| Modifier and Type | Class and Description |
|---|---|
class |
Effect<A>
Run a side effect.
|
static class |
Effect.X<A>
Version of
Effect that allows for throwing a checked exception. |
static class |
Function.X<A,B>
Version of
Function that allows for throwing a checked exception. |
static class |
Function.Xe<A,B,Err>
Version of
Function that allows for throwing a checked exception. |
class |
Predicate<A>
A predicate function.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> Function<List<A>,Function<A,Boolean>> |
Collections.containedIn()
Curried version of
List.contains(Object). |
static <A> Function<A,Boolean> |
Collections.containedIn(List<A> as)
Create a function that checks if its argument is contained in
as. |
Function<A,Function<B,C>> |
Function2.curry()
Currying.
|
Function<A,Function0<B>> |
Function.curry()
Currying.
|
Function<B,C> |
Function2.curry(A a)
Currying.
|
Function<A,Either<Exception,B>> |
Function.X.either() |
<X> Function<A,Either<X,B>> |
Function.either(Function<Exception,X> handler) |
static Function<String,Boolean> |
Option.eq(String compare)
Create an equals function.
|
static <A,B> Function<A[],List<B>> |
Collections.flatMapArrayToList(Function<A,List<B>> f) |
static <A,B> Function<A,Option<B>> |
Collections.getMap(Map<A,B> map)
Return a function to get data from a map.
|
static <A> Function<Option<A>,A> |
Collections.getOrElse(A a) |
Function<A,B> |
Function.handle(Function<? super Exception,B> handler) |
static <A> Function<List<A>,Option<A>> |
Collections.head() |
static <A> Function<A[],Option<A>> |
Arrays.head()
Functional version of
Arrays.head(Object[]). |
<C> Function<C,B> |
Function.o(Function<? super C,? extends A> f)
Function composition.
|
static <A> Function<A,Option<A>> |
Option.option()
Option.option(Object) as a function. |
static <A> Function<Option<A>,Iterator<A>> |
Collections.optionToIterator()
Turn an option into an iterator.
|
static <A> Function<Option<A>,List<A>> |
Collections.optionToList() |
Function<A,B> |
Function.rethrow(Function<? super Exception,? extends Exception> transformer) |
static <A> Function<A,A[]> |
Arrays.singleton(Class<A> type)
Turn a value into a single element array.
|
static <A> Function<A[],A[]> |
Arrays.sort()
Functional version of
Arrays.sort(A[]). |
static <A extends Comparable> |
Collections.sort()
Sort a list.
|
<C> Function<A,C> |
Function.then(Function<? super B,? extends C> f)
Left to right composition:
f then g = g(f(x)) |
Function<A,Void> |
Effect.toFunction()
Return the effect as a function.
|
static <A> Function<A[],List<A>> |
Arrays.toList() |
Function<Tuple<A,B>,C> |
Function2.tupled() |
| Modifier and Type | Method and Description |
|---|---|
static <A> Function<List<A>,Function<A,Boolean>> |
Collections.containedIn()
Curried version of
List.contains(Object). |
Function<A,Function<B,C>> |
Function2.curry()
Currying.
|
| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map<K,V> |
Collections.asMap(List<V> values,
Function<V,K> keyGen)
Partition a list after some predicate
keyGen. |
static <K,V> Map<K,V> |
Collections.asMap(Map<K,V> map,
List<V> values,
Function<V,K> keyGen)
Partition a list after some predicate
keyGen into map. |
abstract <B> Monadics.ListMonadic<B> |
Monadics.ListMonadic.bind(Function<? super A,? extends Iterable<B>> f)
Monadic bind
m a -> (a -> m b) -> m b. |
abstract <X> Either<X,B> |
Either.LeftProjection.bind(Function<A,Either<X,B>> f) |
abstract <B> Monadics.IteratorMonadic<B> |
Monadics.IteratorMonadic.bind(Function<A,Iterator<B>> f)
Monadic bind.
|
abstract <B> Option<B> |
Option.bind(Function<A,Option<B>> f)
Monadic bind operation
m a -> (a -> m b) -> m b. |
abstract <X> Either<A,X> |
Either.RightProjection.bind(Function<B,Either<A,X>> f) |
static <A,B> Monadics.Matcher<A,B> |
Monadics.caseA(Function<A,B> f)
Matches lists with exactly one element.
|
static <A,B> Monadics.Matcher<A,B> |
Monadics.caseN(Function<List<A>,B> f)
Matches any list.
|
abstract Monadics.ListMonadic<A> |
Monadics.ListMonadic.each(Function<? super A,Void> e)
Apply side effect
e to each element. |
abstract Monadics.IteratorMonadic<A> |
Monadics.IteratorMonadic.each(Function<A,Void> e)
Apply side effect
e to each element. |
<X> Function<A,Either<X,B>> |
Function.either(Function<Exception,X> handler) |
abstract boolean |
Monadics.ListMonadic.exists(Function<? super A,Boolean> p)
Check if at least one element satisfies predicate
p. |
abstract boolean |
Monadics.IteratorMonadic.exists(Function<A,Boolean> p)
Check if at least one element satisfies predicate
p. |
static <B,A> Cell<A> |
Cells.fcell(Cell<B> master,
Function<B,A> f) |
abstract Monadics.ListMonadic<A> |
Monadics.ListMonadic.filter(Function<? super A,Boolean> p)
Retain all elements satisfying predicate
p. |
abstract Monadics.IteratorMonadic<A> |
Monadics.IteratorMonadic.filter(Function<A,Boolean> p)
Retain all elements satisfying predicate
p. |
abstract Option<A> |
Monadics.ListMonadic.find(Function<? super A,Boolean> p)
Return the first element satisfying predicate
p. |
static <A,B> Collection<B> |
Collections.flatMap(Collection<A> as,
Function<A,Collection<B>> f)
Deprecated.
use
Monadics |
static <A,B,M extends Collection<B>> |
Collections.flatMap(Collection<A> as,
M bs,
Function<A,Collection<B>> f)
Deprecated.
use
Monadics |
<B> Monadics.ListMonadic<B> |
Monadics.ListMonadic.flatMap(Function<? super A,? extends Iterable<B>> f)
Alias for
Monadics.ListMonadic.bind(Function). |
<X> Either<X,B> |
Either.LeftProjection.flatMap(Function<A,Either<X,B>> f) |
<B> Monadics.IteratorMonadic<B> |
Monadics.IteratorMonadic.flatMap(Function<A,Iterator<B>> f)
Alias for
Monadics.IteratorMonadic.bind(Function). |
<B> Option<B> |
Option.flatMap(Function<A,Option<B>> f) |
<X> Either<A,X> |
Either.RightProjection.flatMap(Function<B,Either<A,X>> f) |
static <A,B> Function<A[],List<B>> |
Collections.flatMapArrayToList(Function<A,List<B>> f) |
abstract <B> Monadics.ListMonadic<B> |
Monadics.ListMonadic.fmap(Function<? super A,? extends B> f)
Apply
f to each elements building a new list. |
abstract <B> Option<B> |
Option.fmap(Function<? super A,? extends B> f) |
abstract <B> Monadics.IteratorMonadic<B> |
Monadics.IteratorMonadic.fmap(Function<A,B> f)
Apply
f to each element. |
abstract <X> X |
Either.fold(Function<? super A,? extends X> left,
Function<? super B,? extends X> right) |
abstract <X> X |
Either.fold(Function<? super A,? extends X> left,
Function<? super B,? extends X> right) |
<B> B |
Option.fold(Function<A,B> some,
Function0<B> none)
Safe decomposition of the option type using functions.
|
abstract Option<A> |
Option.foreach(Function<? super A,Void> f) |
static <K,V> com.google.common.collect.ImmutableMultimap<K,V> |
Collections.groupBy(Iterable<? extends V> values,
Function<? super V,? extends K> group)
Partition a list after some predicate
group into map. |
static <K,V> com.google.common.collect.Multimap<K,V> |
Collections.groupBy(com.google.common.collect.Multimap<K,V> map,
Iterable<? extends V> values,
Function<? super V,? extends K> group)
Partition a list after some predicate
group into map. |
Function<A,B> |
Function.handle(Function<? super Exception,B> handler) |
abstract <B> Monadics.ListMonadic<B> |
Monadics.ListMonadic.inspect(Function<? super List<A>,? extends List<B>> f)
Process the wrapped list en bloc.
|
<B> Cell<B> |
VCell.lift(Function<A,B> f) |
abstract <B> Cell<B> |
Cell.lift(Function<A,B> f) |
static <K,V,X> com.google.common.collect.Multimap<K,V> |
Collections.makeMap(com.google.common.collect.Multimap<K,V> map,
Iterable<? extends X> values,
Function<? super X,Tuple<K,V>> group)
Partition a list after some predicate
group into map. |
static <A,B> Collection<B> |
Collections.map(Collection<A> as,
Function<A,B> f)
Deprecated.
use
Monadics |
static <A,B,M extends Collection<B>> |
Collections.map(Collection<A> as,
M bs,
Function<A,B> f)
Deprecated.
use
Monadics |
<B> Monadics.ListMonadic<B> |
Monadics.ListMonadic.map(Function<? super A,? extends B> f)
Alias for
fmap. |
<B> Option<B> |
Option.map(Function<? super A,? extends B> f) |
<B> Monadics.IteratorMonadic<B> |
Monadics.IteratorMonadic.map(Function<A,B> f)
Alias for
Monadics.IteratorMonadic.fmap(Function). |
abstract <X> Either<X,B> |
Either.LeftProjection.map(Function<A,X> f) |
abstract <X> Either<A,X> |
Either.RightProjection.map(Function<B,X> f) |
<C> Function<C,B> |
Function.o(Function<? super C,? extends A> f)
Function composition.
|
Function<A,B> |
Function.rethrow(Function<? super Exception,? extends Exception> transformer) |
<C> Function<A,C> |
Function.then(Function<? super B,? extends C> f)
Left to right composition:
f then g = g(f(x)) |
<B> Function0<B> |
Function0.then(Function<A,B> f)
Apply this function, then pass the result to
f. |
static <A,B> Collection<A> |
Collections.unique(List<A> as,
Function<A,B> criteria)
Create a list of unique elements determined by a given criteria.
|
| Constructor and Description |
|---|
Xe(Function<Exception,Err> toErr) |
| Modifier and Type | Field and Description |
|---|---|
static Function<String,String[]> |
Strings.csvSplit
Split function to split comma separated values.
|
static Function<String,List<String>> |
Strings.csvSplitList
Split function to split comma separated values.
|
static Function<String,String> |
Strings.lowerCase
A function to convert all of the characters in this String to lower case using the rules of the default locale.
|
static Function<Boolean,Boolean> |
Booleans.not |
static Function<String,Boolean> |
Strings.toBool
Convert a string into a boolean.
|
static Function<String,Option<Double>> |
Strings.toDouble
Convert a string into a long if possible.
|
static Function<String,Option<Integer>> |
Strings.toInt
Convert a string into an integer if possible.
|
static Function<String,List<Integer>> |
Strings.toIntL
Convert a string into an integer if possible.
|
static Function<String,Option<Long>> |
Strings.toLong
Convert a string into a long if possible.
|
static Function<Boolean,Option<Boolean>> |
Options.toOption
Function that turns
true into some(true) and false into none. |
static Function<String,List<String>> |
Strings.trimToNil |
static Function<String,Option<String>> |
Strings.trimToNone
Trim a string and return either
some or none if it's empty. |
| Modifier and Type | Method and Description |
|---|---|
static Function<Integer,Integer> |
Integers.add(Integer val)
Addition.
|
static <A> Function<A,Boolean> |
Booleans.all(Function<A,Boolean>... fs) |
static <A> Function<A,Boolean> |
Booleans.always()
Return a predicate function that always returns true.
|
static <A> Function<A,Boolean> |
Booleans.and(Function<A,Boolean> f,
Function<A,Boolean> g) |
static <A> Function<A,Boolean> |
Booleans.andN(Function<A,Boolean>... fs)
Apply functions lazily and return their results concatenated with boolean AND, i.e.
|
static <A> Function<A,Boolean> |
Booleans.andNEager(Function<A,Boolean>... fs)
Apply all functions and return their results concatenated with boolean AND.
|
static Function<String,String> |
Strings.append(String suffix)
A function to append a suffix to the argument string.
|
static <A> Function<A[],Boolean> |
Tuples.arrayHasSize(int size) |
static <A> Function<Option<A>,List<A>> |
Options.asList() |
static <A> Function<A,Option<String>> |
Strings.asString()
Return
a.toString() wrapped in a some if a != null, none otherwise. |
static <A> Function<A,String> |
Strings.asStringNull()
Return
a.toString() or <null> if argument is null. |
static <A,B> Function<List<A>,List<B>> |
Functions.bind(Function<A,List<B>> f)
Create a bound version of
f for List. |
static <A,B> Function<Option<A>,Option<B>> |
Functions.bindOpt(Function<A,Option<B>> f)
Create a bound version of
f for Option. |
static <A,B> Function<A,B> |
Misc.cast()
Cast from A to B.
|
static <A extends Throwable,B> |
Misc.chuck()
Misc.chuck(Throwable) as a function. |
static <A,B> Function<Function<A,? extends B>,Function<A,B>> |
Functions.co() |
static <A,B> Function<A,B> |
Functions.co(Function<? super A,? extends B> f)
Pure functions are covariant in their result type.
|
static <A> Function<A,A> |
Functions.concat(Function<? super A,? extends A>... fs)
Multiple `then` concatenation.
|
static <A,B> Function<A,B> |
Functions.constant(B b)
Constant function that always returns
b. |
static <A,B> Function<A,B> |
Functions.contra(Function<? super A,B> f)
Pure functions are contravariant in their argument type.
|
static <A,B> Function<A,Function0<B>> |
Functions.curry(Function<A,B> f)
Curry a function of arity 1.
|
static <A,B,C> Function<A,Function<B,C>> |
Functions.curry(Function2<? super A,? super B,? extends C> f)
Curry a function of arity 2.
|
static <A,B,C> Function<B,C> |
Functions.curry(Function2<? super A,? super B,? extends C> f,
A a)
Curry a function of arity 2.
|
static <A,B,C> Function<A,Either<C,B>> |
Functions.either(Function<? super A,? extends B> f,
Function<? super Exception,? extends C> handler)
Create a new function from
f decorated with an exception handler. |
static <A> Function<A,Boolean> |
Booleans.eq(A a) |
static <A,B> Function<A,Option<B>> |
Options.foreach(Function<? super A,? extends Option<? extends B>> f,
Effect<? super B> e)
Apply effect
e to the result of f which is then returned. |
static <A> Function<A,String> |
Strings.format(Format f) |
static <A> Function<A[],Tuple<A,A>> |
Tuples.fromArray() |
static <A> Function<List<A>,Tuple<A,A>> |
Tuples.fromList() |
static <A> Function<Option<A>,A> |
Options.getF() |
static <A> Function<Option<A>,A> |
Options.getOrElse(A none) |
static <A extends Comparable<A>> |
Booleans.gt(A a) |
static <A,B> Function<A,B> |
Functions.handle(Function<? super A,? extends B> f,
Function<? super Exception,? extends B> handler)
Create a new function from
f decorated with an exception handler. |
static <A> Function<A,A> |
Functions.identity()
Identity function.
|
static <A> Function<A,A> |
Functions.identity(A example)
Identity function.
|
static <A> Function<A,A> |
Functions.identity(Class<A> clazz)
Identity function.
|
static <A> Function<A,A> |
Misc.ifThen(A predicate,
A b) |
static <A,B> Function<A,B> |
Functions.ignore(B b)
Constant function that ignores its argument and always returns
a. |
static <A> Function<Option<A>,Boolean> |
Options.isNone()
Option.isNone() as a function. |
static <A> Function<Option<A>,Boolean> |
Options.isSome()
Option.isSome() as a function. |
static <A,B,C> Function<A,List<C>> |
Functions.kleisliCompList(Function<? super A,List<B>> m,
Function<? super B,List<C>> n)
Kleisli composition of list monads.
|
static <A,B> Function<List<A>,List<B>> |
Functions.liftList(Function<A,B> f)
Promote function
a -> b to a List. |
static <A> Function<Option<A>,Option<A>> |
Functions.liftOpt(Effect<? super A> f)
Promote effect
a -> () to an Option. |
static <A,B> Function<Option<A>,Option<B>> |
Functions.liftOpt(Function<? super A,? extends B> f)
Promote function
a -> b to an Option. |
static <A> Function<List<A>,Boolean> |
Tuples.listHasSize(int size) |
static <A extends Comparable<A>> |
Booleans.lt(A a) |
static <A,B,C> Function<A,Option<C>> |
Options.map(Function<? super A,? extends Option<? extends B>> f,
Function<? super B,? extends C> g)
Map
g over the result of f. |
static <A> Function<A,Boolean> |
Booleans.ne(A a) |
static <A,B> Function<A,Option<B>> |
Options.never() |
static <A> Function<A,Boolean> |
Booleans.no()
A function that always returns false.
|
static <A> Function<A,Boolean> |
Booleans.not(Function<A,Boolean> f) |
static <A> Function<A,Boolean> |
Booleans.nothing()
Return a predicate function that always returns false.
|
static <A,B,C> Function<A,C> |
Functions.o(Function<? super B,? extends C> f,
Function<? super A,? extends B> g)
Function composition:
f . |
static <A,B,C,D> Function<A,D> |
Functions.o(Function<? super C,? extends D> f,
Function<? super B,? extends C> g,
Function<? super A,? extends B> h)
f . |
static <A,B,C,D,E> |
Functions.o(Function<? super D,? extends E> f,
Function<? super C,? extends D> g,
Function<? super B,? extends C> h,
Function<? super A,? extends B> i)
f . |
static <A> Function<A,Boolean> |
Booleans.one(Function<A,Boolean>... fs) |
static <A,B> Function<A,B> |
Functions.orElse(B zero,
Function<? super A,Option<B>>... fs)
Treat
fs as partial functions. |
static Function<String,String> |
Strings.prepend(String prefix)
A function to prepend the argument string with a prefix.
|
static Function<String,String> |
Strings.replaceAll(String regex,
String replacement)
Return a function that replaces all occurrences of
regex in the argument with replacement
. |
static <A,B> Function<A,B> |
Functions.rethrow(Function<? super A,? extends B> f,
Function<? super Exception,? extends Exception> transformer)
Create a new function from
f decorated with an exception transformer. |
static Function<String,String[]> |
Strings.split(Pattern splitter)
Create a split function from a regex pattern.
|
static <A,B,C> Function<A,C> |
Functions.then(Function<? super A,? extends B> f,
Function<? super B,? extends C> g)
Left to right composition:
f then g = g(f(x)) |
static <A,B> Function<A,Option<B>> |
Functions.toFn(Map<? extends A,? extends B> m)
Create a (partial) function from a map.
|
static <A,B> Function<Either<A,B>,Option<B>> |
Eithers.toOption()
Like
Either#right()#toOption(). |
static <A,B> Function<A,Tuple<A,B>> |
Tuples.tupleA(B b) |
static <A,B> Function<B,Tuple<A,B>> |
Tuples.tupleB(A a) |
static <A,B,C> Function<Tuple<A,B>,C> |
Functions.tupled(Function2<? super A,? super B,? extends C> f)
Create a tupled version of a function of arity 2.
|
static <A,B> Function<A,B> |
Functions.variant(Function<? super A,? extends B> f)
Pure functions are covariant in their result type and contravariant in their argument type.
|
static <A> Function<A,Boolean> |
Booleans.yes()
A function that always returns true.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B> Function<Function<A,? extends B>,Function<A,B>> |
Functions.co() |
static <A,B> Function<Function<A,? extends B>,Function<A,B>> |
Functions.co() |
static <A,B,C> Function<A,Function<B,C>> |
Functions.curry(Function2<? super A,? super B,? extends C> f)
Curry a function of arity 2.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> Function<A,Boolean> |
Booleans.all(Function<A,Boolean>... fs) |
static <A> Function<A,Boolean> |
Booleans.and(Function<A,Boolean> f,
Function<A,Boolean> g) |
static <A> Function<A,Boolean> |
Booleans.and(Function<A,Boolean> f,
Function<A,Boolean> g) |
static <A,B> Function2<A,B,Boolean> |
Booleans.and2(Function<A,Boolean> f,
Function<B,Boolean> g) |
static <A,B> Function2<A,B,Boolean> |
Booleans.and2(Function<A,Boolean> f,
Function<B,Boolean> g) |
static <A> Function<A,Boolean> |
Booleans.andN(Function<A,Boolean>... fs)
Apply functions lazily and return their results concatenated with boolean AND, i.e.
|
static <A> Function<A,Boolean> |
Booleans.andNEager(Function<A,Boolean>... fs)
Apply all functions and return their results concatenated with boolean AND.
|
static <A,B> Function<List<A>,List<B>> |
Functions.bind(Function<A,List<B>> f)
Create a bound version of
f for List. |
static <A,B> Function<Option<A>,Option<B>> |
Functions.bindOpt(Function<A,Option<B>> f)
Create a bound version of
f for Option. |
static <A,B> Function<A,B> |
Functions.co(Function<? super A,? extends B> f)
Pure functions are covariant in their result type.
|
static <A> Function<A,A> |
Functions.concat(Function<? super A,? extends A>... fs)
Multiple `then` concatenation.
|
static <A,B> Function<A,B> |
Functions.contra(Function<? super A,B> f)
Pure functions are contravariant in their argument type.
|
static <A,B> Function0<B> |
Functions.curry(Function<? super A,? extends B> f,
A a)
Curry a function of arity 1.
|
static <A,B> Function<A,Function0<B>> |
Functions.curry(Function<A,B> f)
Curry a function of arity 1.
|
static <A,B,C> Function<A,Either<C,B>> |
Functions.either(Function<? super A,? extends B> f,
Function<? super Exception,? extends C> handler)
Create a new function from
f decorated with an exception handler. |
static <A,B,C> Function<A,Either<C,B>> |
Functions.either(Function<? super A,? extends B> f,
Function<? super Exception,? extends C> handler)
Create a new function from
f decorated with an exception handler. |
static <A,B> com.entwinemedia.fn.Fn<A,B> |
Functions.fn(Function<A,B> f)
Create a function from the matterhorn-fn module from a common function.
|
static <A,B> Function<A,Option<B>> |
Options.foreach(Function<? super A,? extends Option<? extends B>> f,
Effect<? super B> e)
Apply effect
e to the result of f which is then returned. |
static <A,B> Function<A,B> |
Functions.handle(Function<? super A,? extends B> f,
Function<? super Exception,? extends B> handler)
Create a new function from
f decorated with an exception handler. |
static <A,B> Function<A,B> |
Functions.handle(Function<? super A,? extends B> f,
Function<? super Exception,? extends B> handler)
Create a new function from
f decorated with an exception handler. |
static <A,B,C> Function<A,List<C>> |
Functions.kleisliCompList(Function<? super A,List<B>> m,
Function<? super B,List<C>> n)
Kleisli composition of list monads.
|
static <A,B,C> Function<A,List<C>> |
Functions.kleisliCompList(Function<? super A,List<B>> m,
Function<? super B,List<C>> n)
Kleisli composition of list monads.
|
static <A,B> Function<List<A>,List<B>> |
Functions.liftList(Function<A,B> f)
Promote function
a -> b to a List. |
static <A,B> Function<Option<A>,Option<B>> |
Functions.liftOpt(Function<? super A,? extends B> f)
Promote function
a -> b to an Option. |
static <A,B,C> Function<A,Option<C>> |
Options.map(Function<? super A,? extends Option<? extends B>> f,
Function<? super B,? extends C> g)
Map
g over the result of f. |
static <A,B,C> Function<A,Option<C>> |
Options.map(Function<? super A,? extends Option<? extends B>> f,
Function<? super B,? extends C> g)
Map
g over the result of f. |
static <A> Function<A,Boolean> |
Booleans.not(Function<A,Boolean> f) |
static <A,B> Function0<B> |
Functions.o(Function<? super A,? extends B> f,
Function0<? extends A> g)
Function composition:
f . |
static <A,B,C> Function<A,C> |
Functions.o(Function<? super B,? extends C> f,
Function<? super A,? extends B> g)
Function composition:
f . |
static <A,B,C> Function<A,C> |
Functions.o(Function<? super B,? extends C> f,
Function<? super A,? extends B> g)
Function composition:
f . |
static <A,B,C,D> Function<A,D> |
Functions.o(Function<? super C,? extends D> f,
Function<? super B,? extends C> g,
Function<? super A,? extends B> h)
f . |
static <A,B,C,D> Function<A,D> |
Functions.o(Function<? super C,? extends D> f,
Function<? super B,? extends C> g,
Function<? super A,? extends B> h)
f . |
static <A,B,C,D> Function<A,D> |
Functions.o(Function<? super C,? extends D> f,
Function<? super B,? extends C> g,
Function<? super A,? extends B> h)
f . |
static <A,B,C,D,E> |
Functions.o(Function<? super D,? extends E> f,
Function<? super C,? extends D> g,
Function<? super B,? extends C> h,
Function<? super A,? extends B> i)
f . |
static <A,B,C,D,E> |
Functions.o(Function<? super D,? extends E> f,
Function<? super C,? extends D> g,
Function<? super B,? extends C> h,
Function<? super A,? extends B> i)
f . |
static <A,B,C,D,E> |
Functions.o(Function<? super D,? extends E> f,
Function<? super C,? extends D> g,
Function<? super B,? extends C> h,
Function<? super A,? extends B> i)
f . |
static <A,B,C,D,E> |
Functions.o(Function<? super D,? extends E> f,
Function<? super C,? extends D> g,
Function<? super B,? extends C> h,
Function<? super A,? extends B> i)
f . |
static <A> Function<A,Boolean> |
Booleans.one(Function<A,Boolean>... fs) |
static <A,B> Function<A,B> |
Functions.orElse(B zero,
Function<? super A,Option<B>>... fs)
Treat
fs as partial functions. |
static <A,B> Function<A,B> |
Functions.rethrow(Function<? super A,? extends B> f,
Function<? super Exception,? extends Exception> transformer)
Create a new function from
f decorated with an exception transformer. |
static <A,B> Function<A,B> |
Functions.rethrow(Function<? super A,? extends B> f,
Function<? super Exception,? extends Exception> transformer)
Create a new function from
f decorated with an exception transformer. |
static <A,B,C> Function<A,C> |
Functions.then(Function<? super A,? extends B> f,
Function<? super B,? extends C> g)
Left to right composition:
f then g = g(f(x)) |
static <A,B,C> Function<A,C> |
Functions.then(Function<? super A,? extends B> f,
Function<? super B,? extends C> g)
Left to right composition:
f then g = g(f(x)) |
static <A,B> Function0<B> |
Functions.then(Function0<? extends A> f,
Function<? super A,? extends B> g)
Left to right composition:
f then g = g(f) |
static <A,B> Effect<A> |
Functions.toEffect(Function<? super A,? extends B> f)
Turn a function into an effect by discarding its result.
|
static <A,B> com.google.common.base.Function<A,B> |
Functions.toGuava(Function<? super A,? extends B> f)
Convert function
f into a guava function. |
static <A> Predicate<A> |
Functions.toPredicate(Function<? super A,Boolean> f) |
static <A,B,C> Function2<A,B,C> |
Functions.uncurry(Function<? super A,Function<B,C>> f)
Uncurry to a function of arity 2.
|
static <A,B> Function<A,B> |
Functions.variant(Function<? super A,? extends B> f)
Pure functions are covariant in their result type and contravariant in their argument type.
|
| Modifier and Type | Method and Description |
|---|---|
static <A,B,C> Function2<A,B,C> |
Functions.uncurry(Function<? super A,Function<B,C>> f)
Uncurry to a function of arity 2.
|
| Modifier and Type | Method and Description |
|---|---|
Function<javax.persistence.EntityManager,Long> |
Queries.QueriesBase.count(String q,
P... params)
Queries.QueriesBase.count(EntityManager, String, Object[]) as a function. |
static <A> Function<javax.persistence.EntityManager,Option<A>> |
Queries.find(Class<A> clazz,
Object primaryKey)
EntityManager.find(Class, Object) as a function wrapping the result into an Option. |
<A> Function<javax.persistence.EntityManager,List<A>> |
Queries.TypedQueriesBase.findAll(String q,
Class<A> type,
Tuple<String,?>... params)
|
<A> Function<javax.persistence.EntityManager,List<A>> |
Queries.QueriesBase.findAll(String q,
int offset,
int limit,
P... params) |
<A> Function<javax.persistence.EntityManager,List<A>> |
Queries.QueriesBase.findAll(String q,
Option<Integer> offset,
Option<Integer> limit,
P... params)
|
<A> Function<javax.persistence.EntityManager,List<A>> |
Queries.QueriesBase.findAll(String q,
P... params)
Queries.QueriesBase.findAll(EntityManager, String, Object[]) as a function. |
<A> Function<javax.persistence.EntityManager,Monadics.ListMonadic<A>> |
Queries.QueriesBase.findAllM(String q,
int offset,
int limit,
P... params)
|
<A> Function<javax.persistence.EntityManager,Monadics.ListMonadic<A>> |
Queries.QueriesBase.findAllM(String q,
Option<Integer> offset,
Option<Integer> limit,
P... params)
|
<A> Function<javax.persistence.EntityManager,Monadics.ListMonadic<A>> |
Queries.QueriesBase.findAllM(String q,
P... params)
|
static <A> Function<javax.persistence.EntityManager,Option<A>> |
PersistenceUtil.findById(Class<A> clazz,
Object primaryKey)
Deprecated.
|
<A> Function<javax.persistence.EntityManager,Option<A>> |
Queries.QueriesBase.findFirst(String q,
P... params)
|
<A> Function<javax.persistence.EntityManager,Option<A>> |
Queries.QueriesBase.findSingle(String q,
P... params)
|
static <A> Function<javax.persistence.EntityManager,A> |
Queries.merge(A a)
EntityManager.merge(Object) as a function. |
static <A> Function<javax.persistence.EntityManager,A> |
PersistenceUtil.merge(A a)
Deprecated.
|
static <A> Function<javax.persistence.EntityManager,A> |
Queries.persist(A a)
EntityManager.persist(Object) as a function. |
static <A> Function<javax.persistence.EntityManager,A> |
PersistenceUtil.persist(A a)
Deprecated.
|
static <A> Function<javax.persistence.EntityManager,A> |
Queries.persistOrUpdate(A a) |
static <A> Function<javax.persistence.EntityManager,A> |
Queries.remove(A a)
EntityManager.remove(Object) as a function. |
<A> Function<Function<javax.persistence.EntityManager,A>,A> |
PersistenceEnv.tx()
PersistenceEnv.tx(org.opencastproject.util.data.Function) as a function. |
Function<javax.persistence.EntityManager,Boolean> |
Queries.QueriesBase.update(String q,
P... params)
Queries.QueriesBase.update(EntityManager, String, Object[]) as a function. |
| Modifier and Type | Method and Description |
|---|---|
<A> Function<Function<javax.persistence.EntityManager,A>,A> |
PersistenceEnv.tx()
PersistenceEnv.tx(org.opencastproject.util.data.Function) as a function. |
| Modifier and Type | Method and Description |
|---|---|
static <F> PersistenceEnv2<F> |
PersistenceUtil.equip2(PersistenceEnv penv,
Function<Exception,F> exHandler)
Equip a persistence environment with an exception handler.
|
static <A,B> Option<A> |
PersistenceUtil.find(javax.persistence.EntityManager em,
Function<B,A> toA,
String queryName,
Tuple<String,?>... params)
Deprecated.
|
static <A,B> List<A> |
PersistenceUtil.findAll(javax.persistence.EntityManager em,
Function<B,A> toA,
Option<Integer> offset,
Option<Integer> limit,
String queryName,
Tuple<String,?>... params)
Deprecated.
use
Queries.named findAll(EntityManager, String, Option, Option, Object[]) instead |
static <A,B> List<A> |
PersistenceUtil.findAll(javax.persistence.EntityManager em,
Function<B,A> toA,
String queryName,
Tuple<String,?>... params)
Deprecated.
use
Queries.named findAll(EntityManager, String, Object[]) instead |
abstract <A> A |
PersistenceEnv.tx(Function<javax.persistence.EntityManager,A> transactional)
Run code inside a transaction.
|
<A> Either<F,A> |
PersistenceEnv2.tx(Function<javax.persistence.EntityManager,A> transactional)
Run code inside a transaction.
|
Copyright © 2009–2021 Opencast Project. All rights reserved.