Package org.apache.camel.component.ssh
Class SshShellOutputStringHelper
java.lang.Object
org.apache.camel.component.ssh.SshShellOutputStringHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
beforeLast
(String text, String before) Returns the string before the given token If this token is repeating, than return all text before the last tokenstatic <T> Optional
<T> beforeLast
(String text, String beforeLast, Function<String, T> mapper) Returns an object before the given last tokenstatic String
betweenBeforeLast
(String text, String after, String beforeLast) Returns the string between the given tokensstatic <T> Optional
<T> Returns an object between the given token
-
Method Details
-
beforeLast
Returns the string before the given token If this token is repeating, than return all text before the last token- Parameters:
text
- the textbefore
- the token which is expected to be repeated- Returns:
- the text before the last token, or null if text does not contain the token
-
beforeLast
Returns an object before the given last token- Parameters:
text
- the textbeforeLast
- the last tokenmapper
- a mapping function to convert the string before the token to type T- Returns:
- an Optional describing the result of applying a mapping function to the text before the token.
-
betweenBeforeLast
Returns the string between the given tokens- Parameters:
text
- the textafter
- is the starting token to skip the text before that.beforeLast
- the last token- Returns:
- the text between the tokens, or null if text does not contain the tokens
-
betweenBeforeLast
public static <T> Optional<T> betweenBeforeLast(String text, String after, String before, Function<String, T> mapper) Returns an object between the given token- Parameters:
text
- the textafter
- the before last tokenbefore
- the after tokenmapper
- a mapping function to convert the string between the token to type T- Returns:
- an Optional describing the result of applying a mapping function to the text between the token.
-