java-shortcuts

collection of useful shortcuts

License

License

Categories

Categories

Java Languages
GroupId

GroupId

io.github.codejanovic
ArtifactId

ArtifactId

java-shortcuts
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

java-shortcuts
collection of useful shortcuts
Project URL

Project URL

https://github.com/codejanovic/java-shortcuts
Source Code Management

Source Code Management

https://github.com/codejanovic/java-shortcuts.git

Download java-shortcuts

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.codejanovic/java-shortcuts/ -->
<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-shortcuts</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.codejanovic/java-shortcuts/
implementation 'io.github.codejanovic:java-shortcuts:0.1.0'
// https://jarcasting.com/artifacts/io.github.codejanovic/java-shortcuts/
implementation ("io.github.codejanovic:java-shortcuts:0.1.0")
'io.github.codejanovic:java-shortcuts:jar:0.1.0'
<dependency org="io.github.codejanovic" name="java-shortcuts" rev="0.1.0">
  <artifact name="java-shortcuts" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.codejanovic', module='java-shortcuts', version='0.1.0')
)
libraryDependencies += "io.github.codejanovic" % "java-shortcuts" % "0.1.0"
[io.github.codejanovic/java-shortcuts "0.1.0"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.assertj : assertj-core jar 3.4.1

Project Modules

There are no modules declared in this project.

Build Status Coverage Status License

java-shortcuts

collection of useful shortcuts

Maven

Release artifact

<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-shortcuts</artifactId>
    <version>0.1.0</version>
</dependency>

Snapshot artifact

<dependency>
    <groupId>io.github.codejanovic</groupId>
    <artifactId>java-shortcuts</artifactId>
    <version>0.2.0-SNAPSHOT</version>
</dependency>

Ok, what shortcuts do you got?

String.format()

String.format() shortcut is provided by static Shortcuts.f() method. So instead of ...

final String name = "jim";
final String greeting = String.format("hello, my name is %s", name);

you may use the shortcut ...

import static io.github.codejanovic.java.shortcuts.Shortcuts.f;

final String name = "jim";
final String greeting = f("hello, my name is %s", name);

Objects.requireNonNull()

Objects.requireNonNull() shortcut is provided by static Shortcuts.nn() method. So instead of ...

public final class SomeClass {
    private final String param;
    ...
    public SomeClass(final String param) {
       this.param = Objects.requireNonNull(param); 
    }
    ...
}

you may use the shortcut ...

import io.github.codejanovic.java.shortcuts.Shortcuts.nn;

public final class SomeClass {
    ... 
    private final String param;
    ...
    public SomeClass(final String param) {
       this.param = nn(param); 
    }
    ...
}

Contribution

This project has been created to reuse the shortcuts I created in several projects and provide them through a separate artifact.

Feel free to contribute shortcuts you may use often in your projects and want to share, every Pull-Request is welcome and will be reviewed as soon as possible.

Versions

Version
0.1.0