
com.aerospike.mapper.tools.ResultsUnpacker Maven / Gradle / Ivy
package com.aerospike.mapper.tools;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
public interface ResultsUnpacker {
Object unpack(Object object);
class ListUnpacker implements ResultsUnpacker {
private ListUnpacker() {
}
@Override
public Object unpack(Object object) {
if (object == null) {
return null;
}
else {
List> list = (List>)object;
return list.isEmpty() ? null : list.get(0);
}
}
public final static ListUnpacker instance = new ListUnpacker();
}
class IdentityUnpacker implements ResultsUnpacker {
private IdentityUnpacker() {
}
@Override
public Object unpack(Object object) {
return object;
}
public final static IdentityUnpacker instance = new IdentityUnpacker();
}
class ElementUnpacker implements ResultsUnpacker {
Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy