You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/06 12:50:11 UTC

[isis] branch master updated: ISIS-2297: recreate site index

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dd56833c9 ISIS-2297: recreate site index
7dd56833c9 is described below

commit 7dd56833c9b6f95c1473a66d8744fa1a030f3272
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Apr 6 14:50:04 2022 +0200

    ISIS-2297: recreate site index
---
 .../commons/pages/index/btree/Compound.adoc        |  30 ------
 .../commons/pages/index/btree/FunCompound.adoc     |  32 ------
 .../commons/pages/index/functional/Either.adoc     |  30 ++++++
 .../commons/pages/index/functional/Railway.adoc    | 115 +++++++++++++++++++++
 .../commons/pages/index/functional/Try.adoc        |  21 +++-
 core/adoc/modules/_overview/pages/about.adoc       |   2 +-
 6 files changed, 162 insertions(+), 68 deletions(-)

diff --git a/antora/components/refguide-index/modules/commons/pages/index/btree/Compound.adoc b/antora/components/refguide-index/modules/commons/pages/index/btree/Compound.adoc
deleted file mode 100644
index be3c610e7f..0000000000
--- a/antora/components/refguide-index/modules/commons/pages/index/btree/Compound.adoc
+++ /dev/null
@@ -1,30 +0,0 @@
-= Compound
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-Represents a binary tree data structure.
-
-== API
-
-[source,java]
-.Compound.java
-----
-class Compound<T> {
-  Compound<T> of(T left)
-  Compound<T> of(T left, T right)
-  Compound<T> of(T left, Compound<T> right)
-  Compound<T> of(Compound<T> left, T right)
-  Compound<T> of(Compound<T> left, Compound<T> right)
-  int size()     // <.>
-  Stream<T> streamDepthFirstPostorder()
-  List<T> flatten()
-  Compound<X> map(Function<T, X> mapper)
-  Compound<T> nil()
-}
-----
-
-<.> xref:#size__[size()]
-
-== Members
-
-[#size__]
-=== size()
diff --git a/antora/components/refguide-index/modules/commons/pages/index/btree/FunCompound.adoc b/antora/components/refguide-index/modules/commons/pages/index/btree/FunCompound.adoc
deleted file mode 100644
index 659ea79bf6..0000000000
--- a/antora/components/refguide-index/modules/commons/pages/index/btree/FunCompound.adoc
+++ /dev/null
@@ -1,32 +0,0 @@
-= FunCompound
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-
-Represents a binary tree data structure of function elements.
-
-== API
-
-[source,java]
-.FunCompound.java
-----
-class FunCompound<T, R> {
-  FunCompound<T, R> of(Function<T, R> left)
-  FunCompound<T, R> of(Function<T, R> left, Function<T, R> right)
-  FunCompound<T, R> of(Function<T, R> left, FunCompound<T, R> right)
-  FunCompound<T, R> of(FunCompound<T, R> left, Function<T, R> right)
-  FunCompound<T, R> of(FunCompound<T, R> left, FunCompound<T, R> right)
-  int size()     // <.>
-  Stream<Function<T, R>> streamDepthFirstPostorder()
-  List<Function<T, R>> flatten()
-  Compound<R> apply(T value)
-  FunCompound<T, X> map(Function<R, X> mapper)
-  FunCompound<T, X> compose(FunCompound<R, X> other)
-  FunCompound<T, R> nil()
-}
-----
-
-<.> xref:#size__[size()]
-
-== Members
-
-[#size__]
-=== size()
diff --git a/antora/components/refguide-index/modules/commons/pages/index/functional/Either.adoc b/antora/components/refguide-index/modules/commons/pages/index/functional/Either.adoc
new file mode 100644
index 0000000000..45121306a2
--- /dev/null
+++ b/antora/components/refguide-index/modules/commons/pages/index/functional/Either.adoc
@@ -0,0 +1,30 @@
+= Either
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
+
+The xref:refguide:commons:index/functional/Either.adoc[Either] type represents a value of one of two possible types (a disjoint union), referred to by _left_ or _right_ .
+
+Factory methods _Either#left(Object)_ and _Either#right(Object)_ correspond to the two possible values.
+
+== API
+
+[source,java]
+.Either.java
+----
+class Either<L, R> {
+  Either<L, R> left(L left)
+  Either<L, R> right(R right)
+  Optional<L> left()
+  Optional<R> right()
+  L leftIfAny()
+  R rightIfAny()
+  boolean isLeft()
+  boolean isRight()
+  Either<T, R> mapLeft(Function<L, T> leftMapper)
+  Either<L, T> mapRight(Function<R, T> rightMapper)
+  Either<X, Y> map(Function<L, X> leftMapper, Function<R, Y> rightMapper)
+  T fold(BiFunction<L, R, T> biMapper)
+  T fold(Function<L, T> leftMapper, Function<R, T> rightMapper)
+  void accept(Consumer<L> leftConsumer, Consumer<R> rightConsumer)
+}
+----
+
diff --git a/antora/components/refguide-index/modules/commons/pages/index/functional/Railway.adoc b/antora/components/refguide-index/modules/commons/pages/index/functional/Railway.adoc
new file mode 100644
index 0000000000..2c6ea7d956
--- /dev/null
+++ b/antora/components/refguide-index/modules/commons/pages/index/functional/Railway.adoc
@@ -0,0 +1,115 @@
+= Railway _(interface)_
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
+
+The xref:refguide:commons:index/functional/Railway.adoc[Railway] type represents a value of one of two possible types (a disjoint union) of _Success_ or _Failure_ .
+
+Factory methods _Railway#success(Object)_ and _Railway#failure(Object)_ correspond to the two possible values.
+
+== API
+
+[source,java]
+.Railway.java
+----
+interface Railway<F, S> {
+  Success<F, S> success(S success)
+  Failure<F, S> failure(F failure)
+  boolean isSuccess()
+  boolean isFailure()
+  Optional<S> getSuccess()     // <.>
+  S getSuccessElseFail()
+  S getSuccessElseFail(Function<F, ? extends Throwable> toThrowable)
+  Optional<F> getFailure()     // <.>
+  F getFailureElseFail()
+  Railway<F, S> ifSuccess(Consumer<S> valueConsumer)     // <.>
+  Railway<F, S> ifFailure(Consumer<F> failureConsumer)     // <.>
+  Railway<F, R> mapSuccess(Function<S, R> successMapper)     // <.>
+  Railway<R, S> mapFailure(Function<F, R> failureMapper)     // <.>
+  R fold(Function<F, R> failureMapper, Function<S, R> successMapper)     // <.>
+  Railway<F, S> chain(Function<S, Railway<F, S>> chainingFunction)     // <.>
+}
+----
+
+<.> xref:#getSuccess__[getSuccess()]
++
+--
+Optionally returns the contained _value_ based on presence, that is, if its a _Success_ .
+--
+<.> xref:#getFailure__[getFailure()]
++
+--
+Optionally returns the contained _failure_ based on presence, that is, if its a _Failure_ .
+--
+<.> xref:#ifSuccess__Consumer[ifSuccess(Consumer)]
++
+--
+Peeks into the contained _success_ if its a _Success_ .
+--
+<.> xref:#ifFailure__Consumer[ifFailure(Consumer)]
++
+--
+Peeks into the contained _failure_ if its a _Failure_ .
+--
+<.> xref:#mapSuccess__Function[mapSuccess(Function)]
++
+--
+Maps this xref:refguide:commons:index/functional/Railway.adoc[Railway] to another if its a _Success_ . Otherwise if this is a _Failure_ acts as identity operator.
+--
+<.> xref:#mapFailure__Function[mapFailure(Function)]
++
+--
+Maps this xref:refguide:commons:index/functional/Railway.adoc[Railway] to another if its a _Failure_ . Otherwise if this is a _Success_ acts as identity operator.
+--
+<.> xref:#fold__Function_Function[fold(Function, Function)]
++
+--
+Maps the contained _success_ or _failure_ to a new value of type _R_ using according mapping function _successMapper_ or _failureMapper_ .
+--
+<.> xref:#chain__Function[chain(Function)]
++
+--
+Railway PatternIf this is a _Success_ , returns a new xref:refguide:commons:index/functional/Railway.adoc[Railway] as produced by the chainingFunction, that receives the current success value as input. Otherwise if this is a _Failure_ acts as identity operator and the chainingFunction is not executed.
+--
+
+== Members
+
+[#getSuccess__]
+=== getSuccess()
+
+Optionally returns the contained _value_ based on presence, that is, if its a _Success_ .
+
+[#getFailure__]
+=== getFailure()
+
+Optionally returns the contained _failure_ based on presence, that is, if its a _Failure_ .
+
+[#ifSuccess__Consumer]
+=== ifSuccess(Consumer)
+
+Peeks into the contained _success_ if its a _Success_ .
+
+[#ifFailure__Consumer]
+=== ifFailure(Consumer)
+
+Peeks into the contained _failure_ if its a _Failure_ .
+
+[#mapSuccess__Function]
+=== mapSuccess(Function)
+
+Maps this xref:refguide:commons:index/functional/Railway.adoc[Railway] to another if its a _Success_ . Otherwise if this is a _Failure_ acts as identity operator.
+
+[#mapFailure__Function]
+=== mapFailure(Function)
+
+Maps this xref:refguide:commons:index/functional/Railway.adoc[Railway] to another if its a _Failure_ . Otherwise if this is a _Success_ acts as identity operator.
+
+[#fold__Function_Function]
+=== fold(Function, Function)
+
+Maps the contained _success_ or _failure_ to a new value of type _R_ using according mapping function _successMapper_ or _failureMapper_ .
+
+[#chain__Function]
+=== chain(Function)
+
+Railway PatternIf this is a _Success_ , returns a new xref:refguide:commons:index/functional/Railway.adoc[Railway] as produced by the chainingFunction, that receives the current success value as input. Otherwise if this is a _Failure_ acts as identity operator and the chainingFunction is not executed.
+
+In other words: if once failed stays failed
diff --git a/antora/components/refguide-index/modules/commons/pages/index/functional/Try.adoc b/antora/components/refguide-index/modules/commons/pages/index/functional/Try.adoc
index 049e412967..5426a141b0 100644
--- a/antora/components/refguide-index/modules/commons/pages/index/functional/Try.adoc
+++ b/antora/components/refguide-index/modules/commons/pages/index/functional/Try.adoc
@@ -26,7 +26,8 @@ interface Try<T> {
   Try<R> mapSuccess(Function<T, R> successMapper)     // <.>
   Try<T> mapFailure(UnaryOperator<Throwable> failureMapper)     // <.>
   Try<T> mapEmptyToFailure()     // <.>
-  R fold(Function<Optional<T>, R> successMapper, Function<Throwable, R> failureMapper)     // <.>
+  Either<L, R> map(Function<Throwable, L> failureMapper, Function<Optional<T>, R> successMapper)     // <.>
+  R fold(Function<Throwable, R> failureMapper, Function<Optional<T>, R> successMapper)     // <.>
   Try<R> thenCall(Callable<R> callable)     // <.>
   Try<Void> thenRun(ThrowingRunnable runnable)     // <.>
 }
@@ -35,12 +36,12 @@ interface Try<T> {
 <.> xref:#getValue__[getValue()]
 +
 --
-Optionally returns the contained _value_ based on presence, this is, if its a _Success_ and the value is not _null_ .
+Optionally returns the contained _value_ based on presence, that is, if its a _Success_ and the value is not _null_ .
 --
 <.> xref:#getFailure__[getFailure()]
 +
 --
-Optionally returns the contained _failure_ based on presence, this is, if its a _Failure_ .
+Optionally returns the contained _failure_ based on presence, that is, if its a _Failure_ .
 --
 <.> xref:#ifSuccess__Consumer[ifSuccess(Consumer)]
 +
@@ -77,6 +78,11 @@ Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to another if its
 --
 Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to _Failure_ if its a _Success_ with an empty _value_ . Otherwise acts as identity operator.
 --
+<.> xref:#map__Function_Function[map(Function, Function)]
++
+--
+Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to xref:refguide:commons:index/functional/Either.adoc[Either] using according mapping function _successMapper_ or _failureMapper_ .
+--
 <.> xref:#fold__Function_Function[fold(Function, Function)]
 +
 --
@@ -98,12 +104,12 @@ If its a _Success_ , maps it to another based on given _ThrowingRunnable_ . Othe
 [#getValue__]
 === getValue()
 
-Optionally returns the contained _value_ based on presence, this is, if its a _Success_ and the value is not _null_ .
+Optionally returns the contained _value_ based on presence, that is, if its a _Success_ and the value is not _null_ .
 
 [#getFailure__]
 === getFailure()
 
-Optionally returns the contained _failure_ based on presence, this is, if its a _Failure_ .
+Optionally returns the contained _failure_ based on presence, that is, if its a _Failure_ .
 
 [#ifSuccess__Consumer]
 === ifSuccess(Consumer)
@@ -140,6 +146,11 @@ Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to another if its
 
 Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to _Failure_ if its a _Success_ with an empty _value_ . Otherwise acts as identity operator.
 
+[#map__Function_Function]
+=== map(Function, Function)
+
+Maps this xref:refguide:commons:index/functional/Try.adoc[Try] to xref:refguide:commons:index/functional/Either.adoc[Either] using according mapping function _successMapper_ or _failureMapper_ .
+
 [#fold__Function_Function]
 === fold(Function, Function)
 
diff --git a/core/adoc/modules/_overview/pages/about.adoc b/core/adoc/modules/_overview/pages/about.adoc
index 5055f052c1..d8beeca46d 100644
--- a/core/adoc/modules/_overview/pages/about.adoc
+++ b/core/adoc/modules/_overview/pages/about.adoc
@@ -1322,7 +1322,7 @@ org.yaml:snakeyaml:jar:<managed> +
 
 .Document Index Entries
 ****
-xref:refguide:commons:index/btree/Compound.adoc[Compound], xref:refguide:commons:index/btree/FunCompound.adoc[FunCompound], xref:refguide:commons:index/collections/Can.adoc[Can], xref:refguide:commons:index/collections/Cardinality.adoc[Cardinality], xref:refguide:commons:index/functional/Try.adoc[Try], xref:refguide:commons:index/resource/ResourceCoordinates.adoc[ResourceCoordinates]
+xref:refguide:commons:index/collections/Can.adoc[Can], xref:refguide:commons:index/collections/Cardinality.adoc[Cardinality], xref:refguide:commons:index/functional/Either.adoc[Either], xref:refguide:commons:index/functional/Railway.adoc[Railway], xref:refguide:commons:index/functional/Try.adoc[Try], xref:refguide:commons:index/resource/ResourceCoordinates.adoc[ResourceCoordinates]
 ****
 |===