com.github.andyshao.convert.Convert Maven / Gradle / Ivy
package com.github.andyshao.convert;
import java.util.Objects;
/**
* General convert interface.
* Title:
* Descript:
* Copyright: Copryright(c) Jun 14, 2014
* Encoding:UNIX UTF-8
*
* @author Andy.Shao
*
* @param the input
* @param the output
*/
@FunctionalInterface
public interface Convert {
/** Will change it become private */
@Deprecated
public static final Convert BYTE_2_HEX = ConvertByte2Str.byte2Char(ConvertByte2Str.BYTE_HEX);
public static final Convert BYTES_2_HEX = (Byte[] in) -> {
StringBuilder builder = new StringBuilder();
for (Byte b : in) {
builder.append(Convert.BYTE_2_HEX.convert(b));
}
return builder.toString();
};
public static final Convert HEX_2_BYTES = new ConvertStr2Byte();
public static final Convert