com.github.smartbuf.converter.codec.CollectionCodec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartbuf Show documentation
Show all versions of smartbuf Show documentation
SmartBuf, is a cross-language serialization and deserialization framework, and it has
high performance and compression ratio like protobuf, high compatibility and scalability like json.
The newest version!
package com.github.smartbuf.converter.codec;
import com.github.smartbuf.converter.Codec;
import com.github.smartbuf.converter.Converter;
import com.github.smartbuf.reflect.XType;
import java.util.*;
import java.util.concurrent.*;
/**
* Collection's codec
*
* @author sulin
* @since 2019-05-13 18:40:23
*/
@SuppressWarnings("unchecked")
public final class CollectionCodec extends Codec {
@Converter
public Collection toCollection(Object[] arr) {
return Arrays.asList(arr);
}
@Converter
public Iterable toIterable(Collection collection) {
return collection;
}
@Converter
public Collection toCollection(Iterable it) {
List