Typified Exception

Library to create exceptions typified in a enumerated, in order to be able to list all possible exceptions in one application.

License

License

GroupId

GroupId

org.bytemechanics
ArtifactId

ArtifactId

type-ex
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

Typified Exception
Library to create exceptions typified in a enumerated, in order to be able to list all possible exceptions in one application.
Project Organization

Project Organization

Byte Mechanics
Source Code Management

Source Code Management

https://github.com/bytemechanics/type-ex

Download type-ex

How to add to project

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

Dependencies

test (4)

Group / Artifact Type Version
org.spockframework : spock-core jar 1.1-groovy-2.4
org.codehaus.groovy : groovy-all jar 2.4.13
net.bytebuddy : byte-buddy jar 1.7.9
org.objenesis : objenesis jar 2.6

Project Modules

There are no modules declared in this project.

Type-ex

Latest version Quality Gate Coverage License

Type-ex it's a library to make easy application errors classification.

Motivation

In the old times all application errors were indexed in never-ending lists in big manuals to describe the possible problems and its solutions.

Quick start

  1. First of all include the Jar file in your compile and execution classpath. Maven
	<dependency>
		<groupId>org.bytemechanics</groupId>
		<artifactId>type-ex</artifactId>
		<version>X.X.X</version>
	</dependency>

Graddle

dependencies {
    compile 'org.bytemechanics:type-ex:X.X.X'
}
  1. Create your typified exceptions
package mypackage;
import org.bytemechanics.typeex.impl.TypifiedException;
public enum MyExceptionType implements ExceptionType<TypifiedException>{
	EXCEPTION_TYPE_NO_PARAMETERIZED("This message has no substitution parameters"),
	EXCEPTION_TYPE_PARAMETERIZED("This message has two {} substitution parameters {}"),
	;	
	private final String message;
	MyExceptionType(final String _message){
		this.message=_message;
	}	
	@Override
	public String getMessage() {
		return this.message;
	}
}
  1. Launch an exception Manually
throw MyExceptionType.EXCEPTION_TYPE_PARAMETERIZED
						.from(cause)
						.with("String1",1);

From lambda

Optional.of(null)
		.orElseThrow(MyExceptionType.EXCEPTION_TYPE_PARAMETERIZED
						.from(cause)
						.with("String1",1))
org.bytemechanics

ByteMechanics Foundation

Foundation dedicated to provide opensource libraries and resources to simplify developers life

Versions

Version
1.0.3
1.0.2
1.0.1
1.0.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0