Ti-Utils

The Ti-Utils library contains general utilities functionalities.

License

License

GroupId

GroupId

de.gematik.ti
ArtifactId

ArtifactId

utils
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

Ti-Utils
The Ti-Utils library contains general utilities functionalities.
Project URL

Project URL

https://github.com/gematik/ref-Ti-Utils
Project Organization

Project Organization

de.gematik
Source Code Management

Source Code Management

https://github.com/gematik/ref-Ti-Utils

Download utils

How to add to project

<!-- https://jarcasting.com/artifacts/de.gematik.ti/utils/ -->
<dependency>
    <groupId>de.gematik.ti</groupId>
    <artifactId>utils</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/de.gematik.ti/utils/
implementation 'de.gematik.ti:utils:1.2.1'
// https://jarcasting.com/artifacts/de.gematik.ti/utils/
implementation ("de.gematik.ti:utils:1.2.1")
'de.gematik.ti:utils:jar:1.2.1'
<dependency org="de.gematik.ti" name="utils" rev="1.2.1">
  <artifact name="utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.gematik.ti', module='utils', version='1.2.1')
)
libraryDependencies += "de.gematik.ti" % "utils" % "1.2.1"
[de.gematik.ti/utils "1.2.1"]

Dependencies

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25

test (6)

Group / Artifact Type Version
de.gematik.ti : cardreader.provider.api jar 1.2.1
junit : junit jar 4.12
org.sonarsource.java : sonar-jacoco-listeners jar 3.8
org.mockito : mockito-core jar 3.0.0
org.apache.logging.log4j : log4j-slf4j-impl jar 2.8.1
org.apache.logging.log4j : log4j-core jar 2.8.1

Project Modules

There are no modules declared in this project.

Ti-Utils

This part describes the Ti-Utils functionalities and structure.

API Documentation

Generated API docs are available at https://gematik.github.io/ref-Ti-Utils.

License

Licensed under the Apache License, Version 2.0.

Structure

StreamUtils

The StreamUtils functions capture exception thrown by execution on streams. With special funktions will wrap the call on orginal object and all exception wrapped as StreamRuntimeException.

StreamUtils structure

The usage is described in GettingStarted Ti-Utils

Codec

This package contains a Hex class with converter functionality for hex strings. The Hex class is inspired from org.apache.commons.codec.binary.Hex (Licence: http://www.apache.org/licenses/). Detailed information will found in javadoc of this project.

Codec package structure

Primitives

This package contains a Bytes class with utils functionality for byte arrays. The Hex class is inspired from com.google.common.primitives.Bytes (Apache License 2.0) http://www.apache.org/licenses/LICENSE-2.0.html See the Guava User Guide article on primitive utilities.

Detailed information will found in javadoc of this project.

Primitives package structure

Getting Started

Build setup

To use Ti-Utils library in a project, you need just to include following dependency:

Gradle dependency settings to use Ti-Utils library.

dependencies {
    implementation group: 'de.gematik.ti', name: 'utils', version: '1.2.1'
}

Maven dependency settings to use Ti-Utils library.

<dependencies>
    <dependency>
        <groupId>de.gematik.ti</groupId>
        <artifactId>utils</artifactId>
        <version>1.2.1</version>
    </dependency>
</dependencies>

StreamUtils

The StreamUtils methods are available as static call with de.gematik.ti.utils.streams.stat.StreamUtils and as instance call from de.gematik.ti.utils.streams.StreamUtils.

WrapConsumer call

WrapConsumer call with StreamUtils.

private List<ExceptionClass> list;
list = Arrays.asList(new ExceptionClass(), new ExceptionClass(), new ExceptionClass());

list.stream().forEach(new StreamUtils().wrapConsumer(v -> v.testMethod()));

This is also available as a static method call with StreamUtils from package de.gematik.ti.utils.streams.stat

WrapConsumer call with static StreamUtils.

private List<ExceptionClass> list;
list = Arrays.asList(new ExceptionClass(), new ExceptionClass(), new ExceptionClass());

list.stream().forEach(StreamUtils.wrapConsumer(v -> v.testMethod()));

WrapFunction call

WrapFunction call with StreamUtils.

private List<ExceptionClass> list;
list = Arrays.asList(new ExceptionClass(), new ExceptionClass(), new ExceptionClass());

list.stream().map(new StreamUtils().wrapFunction(v -> v.getValue())).collect(Collectors.toList());

This is also available as a static method call with StreamUtils from package de.gematik.ti.utils.streams.stat

WrapFunction call with static StreamUtils.

private List<ExceptionClass> list;
list = Arrays.asList(new ExceptionClass(), new ExceptionClass(), new ExceptionClass());

list.stream().map(StreamUtils.wrapFunction(v -> v.getValue())).collect(Collectors.toList());
de.gematik.ti

Gematik

Versions

Version
1.2.1