Skip to content

Commit

Permalink
[jOOQ#5396] Add Converter.andThen(Converter) and Converter.inverse() …
Browse files Browse the repository at this point in the history
…default methods
  • Loading branch information
lukaseder committed Jul 5, 2016
1 parent b5e87c6 commit bd42189
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions jOOQ/src/main/java/org/jooq/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,22 @@ public interface Converter<T, U> extends Serializable {
* The user type
*/
Class<U> toType();



/**
* Inverse this converter.
*/
default Converter<U, T> inverse() {
return Converters.inverse(this);
}

/**
* Chain a converter to this converter.
*/
default <X> Converter<T, X> andThen(Converter<? super U, X> converter) {
return Converters.of(this, converter);
}


}

0 comments on commit bd42189

Please sign in to comment.